-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Auto-configure a JwtAuthenticationConverter #38105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When merging, we should let the bean back off if no properties are set. Right now, it always supplies the JWT converter. |
The JwtConverter bean is only supplied, if one of the following properties is there: * spring.security.oauth2.resourceserver.jwt.authority-prefix * spring.security.oauth2.resourceserver.jwt.principal-claim-name * spring.security.oauth2.resourceserver.jwt.authorities-claim-name See spring-projectsgh-38105
I got some amended changes here: https://github.com/mhalbritter/spring-boot/tree/pr/38105 |
The JwtConverter bean is only supplied, if one of the following properties is there: * spring.security.oauth2.resourceserver.jwt.authority-prefix * spring.security.oauth2.resourceserver.jwt.principal-claim-name * spring.security.oauth2.resourceserver.jwt.authorities-claim-name See gh-38105
Thanks a lot! |
Are you planning to add nested authorities-claim-name ? For example, Keycloak is nesting the roles in realm_access.roles |
@Jojoooo1 I don't think so, but I'm not sure that I understand what you're asking for. Please open a new issue describing how to configure a |
Sorry I was not very clear, I was wondering if in the future you are planning to allow nested claim name with the property spring.security.oauth2.resourceserver.jwt.authorities-claim-name. My use case was regarding Keycloak for example the jwt structure is as follows: "realm_access": {
"roles": [
"default-roles-api",
"offline_access",
"uma_authorization",
"management_user"
]
},
"resource_access": {
"account": {
"roles": [
"manage-account",
"manage-account-links",
"view-profile"
]
}
}, |
|
Adds support for auto-configuring
JwtAuthenticationConverter
(andReactiveJwtAuthenticationConverter
) with following properties:spring.security.oauth2.resourceserver.jwt.authority-prefix
spring.security.oauth2.resourceserver.jwt.authorities-claim-delimiter
spring.security.oauth2.resourceserver.jwt.authorities-claim-name
spring.security.oauth2.resourceserver.jwt.principal-claim-name
Closes gh-33689