I have a Spring Boot app that is using the Okta starter, and unable to get the “groups” claim for a user once they authenticate. Here’s my setup:
I have an Okta application created that includes the following in the “OpenID Connect ID Token” section:
Groups claim type: Filter
Groups claim filter: groups
Matches regex “.*” (without quotes)
The application is setup with:
spring-boot-starter-parent:3.3.2
okta-spring-boot-starter:3.0.7
I include the following properties in application.properties
okta.oauth2.issuer=
okta.oauth2.client-id=
okta.oauth2.client-secret=
okta.oauth2.redirect-uri=/authorization-code/callback
I have a controller method with the following parameter:
@AuthenticationPrincipal OidcUser oidcUser
With this I’m able to call oidcUser.getClaims()
, and while I receive claims, I do not have one for groups
.
Any way to get the groups
claim for the user without a custom Authorization Server? (Not licensed for that)
Thanks.