diff --git a/.readme_resources/auth0-user-data-rule.png b/.readme_resources/auth0-user-data-rule.png deleted file mode 100644 index c14913598..000000000 Binary files a/.readme_resources/auth0-user-data-rule.png and /dev/null differ diff --git a/README.MD b/README.MD index 5824fdd19..4469b7b46 100644 --- a/README.MD +++ b/README.MD @@ -146,7 +146,7 @@ Using such libs is dead simple: just declare depedency on one of those libs and jsonObjectClaims = { @JsonObjectClaim(name = "obj1", value = obj1), @JsonObjectClaim(name = "obj2", value = obj2)}, jsonObjectArrayClaims = @JsonObjectArrayClaim(name = "objArr1", value = { obj3, obj4}), nestedClaims = { @NestedClaims( - name = "https://c4-soft.com/spring-addons", + name = "https://c4-soft.com/user", intClaims = { @IntClaim(name = "nested_int1", value = 42), @IntClaim(name = "nested_int2", value = 51) }, longClaims = { @LongClaim(name = "nested_long1", value = 42), @LongClaim(name = "nested_long2", value = 51) }, doubleClaims = { @DoubleClaim(name = "nested_double1", value = 4.2), @DoubleClaim(name = "nested_double2", value = 5.1) }, diff --git a/samples/tutorials/auth0.md b/samples/tutorials/auth0.md index 4adb3a27e..0197b1d77 100644 --- a/samples/tutorials/auth0.md +++ b/samples/tutorials/auth0.md @@ -43,30 +43,26 @@ The issuer to configure in tutorials is `https://{Domain}/`. The "Domain" placeh ![Application details](https://github.com/ch4mpy/spring-addons/blob/master/.readme_resources/auth0-application-details.png) -Next, create a rule to enrich the access tokens with user data: -- browse to "Auth Pipeline -> Rules" -- click "+ Create" and then "<> Empty rule" -- enter `Add user data to access and ID tokens` as "Name" -- set the following rule script: +Next, create an action to enrich the access tokens with user data: +- browse to "Actions -> Flows -> Login" +- click "+ Add Action" and then "Build Custom" +- enter `Add user data to access and ID tokens` as "Name" and keep "Login / Post Login" as well as default Runtime version +- script body: ```typescript -function addUserData(user, context, callback) { - context.accessToken['https://c4-soft.com/spring-addons'] = user; - context.idToken['https://c4-soft.com/spring-addons'] = user; - return callback(null, user, context); -} +exports.onExecutePostLogin = async (event, api) => { + const namespace = 'https://c4-soft.com'; + const user = Object.assign({}, event.user); + user.roles = event.authorization?.roles || []; + api.accessToken.setCustomClaim(`${namespace}/user`, user); + api.idToken.setCustomClaim(`${namespace}/user`, user); + return; // success +}; ``` -![Rule to add user data to access tokens](https://github.com/ch4mpy/spring-addons/blob/master/.readme_resources/auth0-user-data-rule.png) From the left menu, select "User Management -> Users" and add at least a user for yourself. -Select "Extensions" from the left menu and: -- install `Auth0 Authorization` -- click "Auth0 Authorization" to navigate to "Authorization Extension" details -- click "Go To Configuration" -- enable `Groups`, `Roles` and `Permissions` toggles -- click "ROTATE" -- click "PUBLISH RULE" -- from the left menu, click "Roles" and add a `NICE` role -- from the left menu, click "Users", open one of the users details, browse to "Roles" tab, click "+ ADD ROLE TO USER", and assign the `NICE` role +From the left menu, click "Roles" and add a `NICE` role + +From the left menu, click "Users", open one of the users details, browse to "Roles" tab, click "+ ADD ROLE TO USER", and assign the `NICE` role You're all set to update tutorials configuration with your own Auth0 instance & confidential client \ No newline at end of file diff --git a/samples/tutorials/bff/README.md b/samples/tutorials/bff/README.md index 46ba862d7..208b0f2f5 100644 --- a/samples/tutorials/bff/README.md +++ b/samples/tutorials/bff/README.md @@ -212,10 +212,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions client: client-uri: ${gateway-uri} security-matchers: /** @@ -427,7 +427,7 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - path: roles - path: permissions diff --git a/samples/tutorials/bff/gateway/src/main/resources/application.yml b/samples/tutorials/bff/gateway/src/main/resources/application.yml index 56ec1d70c..946896c81 100644 --- a/samples/tutorials/bff/gateway/src/main/resources/application.yml +++ b/samples/tutorials/bff/gateway/src/main/resources/application.yml @@ -110,10 +110,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions client: client-uri: ${gateway-uri} security-matchers: /** diff --git a/samples/tutorials/bff/greetings-api/src/main/resources/application.yml b/samples/tutorials/bff/greetings-api/src/main/resources/application.yml index 8952e5847..dee0684b2 100644 --- a/samples/tutorials/bff/greetings-api/src/main/resources/application.yml +++ b/samples/tutorials/bff/greetings-api/src/main/resources/application.yml @@ -39,10 +39,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions permit-all: - "/public/**" - "/actuator/health/readiness" diff --git a/samples/tutorials/resource-server_multitenant_dynamic/README.md b/samples/tutorials/resource-server_multitenant_dynamic/README.md index 3d9beddc1..7fb45f549 100644 --- a/samples/tutorials/resource-server_multitenant_dynamic/README.md +++ b/samples/tutorials/resource-server_multitenant_dynamic/README.md @@ -122,10 +122,10 @@ com: authorities: - path: cognito:groups - location: https://dev-ch4mpy.eu.auth0.com - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions --- scheme: https keycloak-port: 8443 diff --git a/samples/tutorials/resource-server_multitenant_dynamic/src/main/resources/application.yml b/samples/tutorials/resource-server_multitenant_dynamic/src/main/resources/application.yml index e01d97eca..ba216bf08 100644 --- a/samples/tutorials/resource-server_multitenant_dynamic/src/main/resources/application.yml +++ b/samples/tutorials/resource-server_multitenant_dynamic/src/main/resources/application.yml @@ -30,10 +30,10 @@ com: authorities: - path: cognito:groups - location: https://dev-ch4mpy.eu.auth0.com - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions permit-all: - "/actuator/health/readiness" - "/actuator/health/liveness" diff --git a/samples/tutorials/resource-server_with_additional-header/README.md b/samples/tutorials/resource-server_with_additional-header/README.md index bc96241d6..b5f85877e 100644 --- a/samples/tutorials/resource-server_with_additional-header/README.md +++ b/samples/tutorials/resource-server_with_additional-header/README.md @@ -137,10 +137,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions --- scheme: https diff --git a/samples/tutorials/resource-server_with_additional-header/src/main/resources/application.yml b/samples/tutorials/resource-server_with_additional-header/src/main/resources/application.yml index c796375ad..c9f2defc4 100644 --- a/samples/tutorials/resource-server_with_additional-header/src/main/resources/application.yml +++ b/samples/tutorials/resource-server_with_additional-header/src/main/resources/application.yml @@ -33,10 +33,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions permit-all: - "/actuator/health/readiness" - "/actuator/health/liveness" diff --git a/samples/tutorials/resource-server_with_introspection/README.md b/samples/tutorials/resource-server_with_introspection/README.md index 03b2d31c9..7d922313c 100644 --- a/samples/tutorials/resource-server_with_introspection/README.md +++ b/samples/tutorials/resource-server_with_introspection/README.md @@ -151,10 +151,10 @@ com: security: issuers: - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: $['https://c4-soft.com/spring-addons']['roles'] - - path: $['https://c4-soft.com/spring-addons']['permissions'] + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions spring: security: oauth2: diff --git a/samples/tutorials/resource-server_with_introspection/src/main/resources/application.yml b/samples/tutorials/resource-server_with_introspection/src/main/resources/application.yml index 98c47f8c6..8b64c6ec8 100644 --- a/samples/tutorials/resource-server_with_introspection/src/main/resources/application.yml +++ b/samples/tutorials/resource-server_with_introspection/src/main/resources/application.yml @@ -71,10 +71,10 @@ com: security: issuers: - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: $['https://c4-soft.com/spring-addons']['roles'] - - path: $['https://c4-soft.com/spring-addons']['permissions'] + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions spring: security: oauth2: diff --git a/samples/tutorials/resource-server_with_jwtauthenticationtoken/README.md b/samples/tutorials/resource-server_with_jwtauthenticationtoken/README.md index f9cedcffc..4332c543d 100644 --- a/samples/tutorials/resource-server_with_jwtauthenticationtoken/README.md +++ b/samples/tutorials/resource-server_with_jwtauthenticationtoken/README.md @@ -85,7 +85,7 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - path: roles - path: permissions diff --git a/samples/tutorials/resource-server_with_jwtauthenticationtoken/src/main/resources/application.yml b/samples/tutorials/resource-server_with_jwtauthenticationtoken/src/main/resources/application.yml index c796375ad..c2cb934b2 100644 --- a/samples/tutorials/resource-server_with_jwtauthenticationtoken/src/main/resources/application.yml +++ b/samples/tutorials/resource-server_with_jwtauthenticationtoken/src/main/resources/application.yml @@ -33,7 +33,7 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - path: roles - path: permissions diff --git a/samples/tutorials/resource-server_with_oauthentication/README.md b/samples/tutorials/resource-server_with_oauthentication/README.md index ee78403c2..57b964c07 100644 --- a/samples/tutorials/resource-server_with_oauthentication/README.md +++ b/samples/tutorials/resource-server_with_oauthentication/README.md @@ -86,10 +86,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions --- scheme: https diff --git a/samples/tutorials/resource-server_with_oauthentication/src/main/resources/application.yml b/samples/tutorials/resource-server_with_oauthentication/src/main/resources/application.yml index 64c2a71b6..f480f4ffa 100644 --- a/samples/tutorials/resource-server_with_oauthentication/src/main/resources/application.yml +++ b/samples/tutorials/resource-server_with_oauthentication/src/main/resources/application.yml @@ -34,10 +34,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions permit-all: - "/actuator/health/readiness" - "/actuator/health/liveness" diff --git a/samples/tutorials/resource-server_with_specialized_oauthentication/src/main/resources/application.yml b/samples/tutorials/resource-server_with_specialized_oauthentication/src/main/resources/application.yml index edfdeda26..0de95f861 100644 --- a/samples/tutorials/resource-server_with_specialized_oauthentication/src/main/resources/application.yml +++ b/samples/tutorials/resource-server_with_specialized_oauthentication/src/main/resources/application.yml @@ -33,10 +33,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions permit-all: - "/greet/public" - "/actuator/health/readiness" diff --git a/samples/tutorials/resource-server_with_ui/README.md b/samples/tutorials/resource-server_with_ui/README.md index 7a8a65029..638cd6e0e 100644 --- a/samples/tutorials/resource-server_with_ui/README.md +++ b/samples/tutorials/resource-server_with_ui/README.md @@ -154,9 +154,9 @@ com: authorities: - path: $.cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: $.roles + - path: $['https://c4-soft.com/user']['roles'] - path: $.permissions permit-all: - /actuator/health/readiness diff --git a/samples/tutorials/resource-server_with_ui/src/main/resources/application.yml b/samples/tutorials/resource-server_with_ui/src/main/resources/application.yml index b563d2fca..1444dee46 100644 --- a/samples/tutorials/resource-server_with_ui/src/main/resources/application.yml +++ b/samples/tutorials/resource-server_with_ui/src/main/resources/application.yml @@ -75,9 +75,9 @@ com: authorities: - path: $.cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: $.roles + - path: $['https://c4-soft.com/user']['roles'] - path: $.permissions permit-all: - /actuator/health/readiness diff --git a/samples/webflux-jwt-default/README.md b/samples/webflux-jwt-default/README.md index 58b41ab79..9aba08e0b 100644 --- a/samples/webflux-jwt-default/README.md +++ b/samples/webflux-jwt-default/README.md @@ -58,10 +58,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions permit-all: - "/greet/public" - "/actuator/health/readiness" diff --git a/samples/webflux-jwt-default/src/main/resources/application.yml b/samples/webflux-jwt-default/src/main/resources/application.yml index 9638a348e..e13808594 100644 --- a/samples/webflux-jwt-default/src/main/resources/application.yml +++ b/samples/webflux-jwt-default/src/main/resources/application.yml @@ -23,10 +23,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions permit-all: - "/greet/public" - "/actuator/health/readiness" diff --git a/samples/webflux-jwt-oauthentication/src/main/resources/application.yml b/samples/webflux-jwt-oauthentication/src/main/resources/application.yml index edfdeda26..0de95f861 100644 --- a/samples/webflux-jwt-oauthentication/src/main/resources/application.yml +++ b/samples/webflux-jwt-oauthentication/src/main/resources/application.yml @@ -33,10 +33,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions permit-all: - "/greet/public" - "/actuator/health/readiness" diff --git a/samples/webmvc-jwt-default-jpa-authorities/src/main/resources/application.yml b/samples/webmvc-jwt-default-jpa-authorities/src/main/resources/application.yml index af56682d4..a5d44e524 100644 --- a/samples/webmvc-jwt-default-jpa-authorities/src/main/resources/application.yml +++ b/samples/webmvc-jwt-default-jpa-authorities/src/main/resources/application.yml @@ -45,10 +45,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions permit-all: - "/greet/public" - "/actuator/health/readiness" diff --git a/samples/webmvc-jwt-default/README.md b/samples/webmvc-jwt-default/README.md index 8a645cbb0..6047decad 100644 --- a/samples/webmvc-jwt-default/README.md +++ b/samples/webmvc-jwt-default/README.md @@ -58,10 +58,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions permit-all: - "/greet/public" - "/actuator/health/readiness" diff --git a/samples/webmvc-jwt-default/src/main/resources/application.yml b/samples/webmvc-jwt-default/src/main/resources/application.yml index 7a8510a41..f3d331c01 100644 --- a/samples/webmvc-jwt-default/src/main/resources/application.yml +++ b/samples/webmvc-jwt-default/src/main/resources/application.yml @@ -34,10 +34,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions permit-all: - "/greet/public" - "/actuator/health/readiness" diff --git a/samples/webmvc-jwt-default/src/test/java/com/c4_soft/springaddons/samples/webmvc_jwtauthenticationtoken/GreetingControllerAnnotatedTest.java b/samples/webmvc-jwt-default/src/test/java/com/c4_soft/springaddons/samples/webmvc_jwtauthenticationtoken/GreetingControllerAnnotatedTest.java index 77203c1ef..26fa16117 100644 --- a/samples/webmvc-jwt-default/src/test/java/com/c4_soft/springaddons/samples/webmvc_jwtauthenticationtoken/GreetingControllerAnnotatedTest.java +++ b/samples/webmvc-jwt-default/src/test/java/com/c4_soft/springaddons/samples/webmvc_jwtauthenticationtoken/GreetingControllerAnnotatedTest.java @@ -171,7 +171,7 @@ void givenUserIsGrantedWithAuthorizedPersonnel_whenGetSecuredMethod_thenOk() thr jsonObjectClaims = { @JsonObjectClaim(name = "obj1", value = obj1), @JsonObjectClaim(name = "obj2", value = obj2)}, jsonObjectArrayClaims = @JsonObjectArrayClaim(name = "objArr1", value = { obj3, obj4}), nestedClaims = { @NestedClaims( - name = "https://c4-soft.com/spring-addons", + name = "https://c4-soft.com/user", intClaims = { @IntClaim(name = "nested_int1", value = 42), @IntClaim(name = "nested_int2", value = 51) }, longClaims = { @LongClaim(name = "nested_long1", value = 42), @LongClaim(name = "nested_long2", value = 51) }, doubleClaims = { @DoubleClaim(name = "nested_double1", value = 4.2), @DoubleClaim(name = "nested_double2", value = 5.1) }, @@ -187,6 +187,6 @@ void givenUserIsGrantedWithAuthorizedPersonnel_whenGetSecuredMethod_thenOk() thr void givenUserIsAuthenticated_whenGetClaims_thenOk() throws Exception { api.get("/claims").andExpect(status().isOk()).andExpect( content().string( - "{\"sub\":\"Ch4mpy\",\"objArr1\":[{\"prop1_1\":{\"nested1_1_1\":\"value1\"},\"prop1_2\":{\"nested1_2_1\":221}},{\"prop2_2\":{\"nested2_2_1\":221},\"prop2_1\":{\"nested2_1_1\":\"value2\"}}],\"strArr1\":[\"a\",\"b\",\"c\"],\"strArr2\":[\"D\",\"E\",\"F\"],\"preferred_username\":\"user\",\"long2\":51,\"int2\":51,\"int1\":42,\"long1\":42,\"url1\":\"https://localhost:8080/greet\",\"url2\":\"https://localhost:4200/home\",\"str1\":\"String 1\",\"str2\":\"String 2\",\"address\":{},\"email_verified\":false,\"obj2\":{\"prop2_1\":{\"nested2_1_1\":{\"nested2_1_1_1\":2111}}},\"obj1\":{\"prop1_1\":{\"nested1_1_1\":\"value1\"},\"prop1_2\":{\"nested1_2_1\":121}},\"phone_number_verified\":false,\"date1\":\"2023-04-04T00:42:00.000+00:00\",\"https://c4-soft.com/spring-addons\":{\"nested_int1\":42,\"nested_int2\":51,\"nested_str2\":\"String 2\",\"nested_str1\":\"String 1\",\"nested_objArr1\":[{\"prop1_1\":{\"nested1_1_1\":\"value1\"},\"prop1_2\":{\"nested1_2_1\":221}},{\"prop2_2\":{\"nested2_2_1\":221},\"prop2_1\":{\"nested2_1_1\":\"value2\"}}],\"nested_strArr1\":[\"a\",\"b\",\"c\"],\"nested_obj2\":{\"prop2_1\":{\"nested2_1_1\":{\"nested2_1_1_1\":2111}}},\"nested_strArr2\":[\"D\",\"E\",\"F\"],\"nested_obj1\":{\"prop1_1\":{\"nested1_1_1\":\"value1\"},\"prop1_2\":{\"nested1_2_1\":121}},\"nested_double2\":5.1,\"nested_double1\":4.2,\"nested_epoch2\":\"2023-04-04T22:42:52.000+00:00\",\"nested_epoch1\":\"2022-12-14T00:40:00.000+00:00\",\"nested_long2\":51,\"nested_long1\":42,\"nested_url1\":\"https://localhost:8080/greet\",\"nested_url2\":\"https://localhost:4200/home\",\"nested_date1\":\"2023-04-04T00:42:00.000+00:00\",\"nested_uri1\":\"https://localhost:8080/greet\",\"nested_uri2\":\"https://localhost:4200/home#greet\"},\"uri2\":\"https://localhost:4200/home#greet\",\"uri1\":\"https://localhost:8080/greet\",\"double2\":5.1,\"double1\":4.2,\"epoch2\":\"2023-04-04T22:42:52.000+00:00\",\"epoch1\":\"2022-12-14T00:40:00.000+00:00\"}")); + "{\"sub\":\"Ch4mpy\",\"objArr1\":[{\"prop1_1\":{\"nested1_1_1\":\"value1\"},\"prop1_2\":{\"nested1_2_1\":221}},{\"prop2_2\":{\"nested2_2_1\":221},\"prop2_1\":{\"nested2_1_1\":\"value2\"}}],\"strArr1\":[\"a\",\"b\",\"c\"],\"strArr2\":[\"D\",\"E\",\"F\"],\"preferred_username\":\"user\",\"long2\":51,\"int2\":51,\"int1\":42,\"long1\":42,\"url1\":\"https://localhost:8080/greet\",\"url2\":\"https://localhost:4200/home\",\"str1\":\"String 1\",\"str2\":\"String 2\",\"address\":{},\"email_verified\":false,\"obj2\":{\"prop2_1\":{\"nested2_1_1\":{\"nested2_1_1_1\":2111}}},\"obj1\":{\"prop1_1\":{\"nested1_1_1\":\"value1\"},\"prop1_2\":{\"nested1_2_1\":121}},\"phone_number_verified\":false,\"date1\":\"2023-04-04T00:42:00.000+00:00\",\"uri2\":\"https://localhost:4200/home#greet\",\"uri1\":\"https://localhost:8080/greet\",\"double2\":5.1,\"https://c4-soft.com/user\":{\"nested_int1\":42,\"nested_int2\":51,\"nested_str2\":\"String 2\",\"nested_str1\":\"String 1\",\"nested_objArr1\":[{\"prop1_1\":{\"nested1_1_1\":\"value1\"},\"prop1_2\":{\"nested1_2_1\":221}},{\"prop2_2\":{\"nested2_2_1\":221},\"prop2_1\":{\"nested2_1_1\":\"value2\"}}],\"nested_strArr1\":[\"a\",\"b\",\"c\"],\"nested_obj2\":{\"prop2_1\":{\"nested2_1_1\":{\"nested2_1_1_1\":2111}}},\"nested_strArr2\":[\"D\",\"E\",\"F\"],\"nested_obj1\":{\"prop1_1\":{\"nested1_1_1\":\"value1\"},\"prop1_2\":{\"nested1_2_1\":121}},\"nested_double2\":5.1,\"nested_double1\":4.2,\"nested_epoch2\":\"2023-04-04T22:42:52.000+00:00\",\"nested_epoch1\":\"2022-12-14T00:40:00.000+00:00\",\"nested_long2\":51,\"nested_long1\":42,\"nested_url1\":\"https://localhost:8080/greet\",\"nested_url2\":\"https://localhost:4200/home\",\"nested_date1\":\"2023-04-04T00:42:00.000+00:00\",\"nested_uri1\":\"https://localhost:8080/greet\",\"nested_uri2\":\"https://localhost:4200/home#greet\"},\"double1\":4.2,\"epoch2\":\"2023-04-04T22:42:52.000+00:00\",\"epoch1\":\"2022-12-14T00:40:00.000+00:00\"}")); } } diff --git a/samples/webmvc-jwt-oauthentication/src/main/resources/application.yml b/samples/webmvc-jwt-oauthentication/src/main/resources/application.yml index edfdeda26..0de95f861 100644 --- a/samples/webmvc-jwt-oauthentication/src/main/resources/application.yml +++ b/samples/webmvc-jwt-oauthentication/src/main/resources/application.yml @@ -33,10 +33,10 @@ com: authorities: - path: cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: roles - - path: permissions + - path: $['https://c4-soft.com/user']['roles'] + - path: $.permissions permit-all: - "/greet/public" - "/actuator/health/readiness" diff --git a/webflux/spring-addons-webflux-client/README.md b/webflux/spring-addons-webflux-client/README.md index b9bbc33d6..4c55b9ca1 100644 --- a/webflux/spring-addons-webflux-client/README.md +++ b/webflux/spring-addons-webflux-client/README.md @@ -124,9 +124,9 @@ com: authorities: - path: $.cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: $.roles + - path: $['https://c4-soft.com/user']['roles'] - path: $.permissions client: client-uri: ${gateway-uri} diff --git a/webmvc/spring-addons-webmvc-client/README.md b/webmvc/spring-addons-webmvc-client/README.md index 7d930c71e..22de58e68 100644 --- a/webmvc/spring-addons-webmvc-client/README.md +++ b/webmvc/spring-addons-webmvc-client/README.md @@ -108,9 +108,9 @@ com: authorities: - path: $.cognito:groups - location: ${auth0-issuer} - username-claim: $['https://c4-soft.com/spring-addons']['name'] + username-claim: $['https://c4-soft.com/user']['name'] authorities: - - path: $.roles + - path: $['https://c4-soft.com/user']['roles'] - path: $.permissions permit-all: - /actuator/health/readiness