@Singleton @Requires(configuration="io.micronaut.security.token.jwt") public class DefaultOpenIdUserDetailsMapper extends java.lang.Object implements OpenIdUserDetailsMapper
OpenIdUserDetailsMapper
that uses
the subject claim for the username and populates the attributes with the
non JWT standard claims. If an OpenIdUserDetailsMapper
bean is created
with a named qualifier that is the same name of the provider, that bean will
be used instead of this one.OPENID_TOKEN_KEY
Constructor and Description |
---|
DefaultOpenIdUserDetailsMapper(OpenIdAdditionalClaimsConfiguration openIdAdditionalClaimsConfiguration)
Deprecated.
|
DefaultOpenIdUserDetailsMapper(OpenIdAdditionalClaimsConfiguration openIdAdditionalClaimsConfiguration,
AuthenticationModeConfiguration authenticationModeConfiguration)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
buildAttributes(java.lang.String providerName,
OpenIdTokenResponse tokenResponse,
OpenIdClaims openIdClaims) |
AuthenticationResponse |
createAuthenticationResponse(java.lang.String providerName,
OpenIdTokenResponse tokenResponse,
OpenIdClaims openIdClaims,
State state) |
UserDetails |
createUserDetails(java.lang.String providerName,
OpenIdTokenResponse tokenResponse,
OpenIdClaims openIdClaims) |
protected java.util.List<java.lang.String> |
getRoles(java.lang.String providerName,
OpenIdTokenResponse tokenResponse,
OpenIdClaims openIdClaims) |
protected java.lang.String |
getUsername(java.lang.String providerName,
OpenIdTokenResponse tokenResponse,
OpenIdClaims openIdClaims) |
@Inject public DefaultOpenIdUserDetailsMapper(OpenIdAdditionalClaimsConfiguration openIdAdditionalClaimsConfiguration, AuthenticationModeConfiguration authenticationModeConfiguration)
openIdAdditionalClaimsConfiguration
- The additional claims configurationauthenticationModeConfiguration
- Authentication Mode Configuration@Deprecated public DefaultOpenIdUserDetailsMapper(OpenIdAdditionalClaimsConfiguration openIdAdditionalClaimsConfiguration)
DefaultOpenIdUserDetailsMapper(OpenIdAdditionalClaimsConfiguration, AuthenticationModeConfiguration)
instead.openIdAdditionalClaimsConfiguration
- The additional claims configuration@NonNull public UserDetails createUserDetails(java.lang.String providerName, OpenIdTokenResponse tokenResponse, OpenIdClaims openIdClaims)
createUserDetails
in interface OpenIdUserDetailsMapper
providerName
- The OpenID provider nametokenResponse
- The token responseopenIdClaims
- The OpenID claims@NonNull public AuthenticationResponse createAuthenticationResponse(java.lang.String providerName, OpenIdTokenResponse tokenResponse, OpenIdClaims openIdClaims, @Nullable State state)
createAuthenticationResponse
in interface OpenIdUserDetailsMapper
providerName
- The OpenID provider nametokenResponse
- The token responseopenIdClaims
- The OpenID claimsstate
- The state of the responseprotected java.util.Map<java.lang.String,java.lang.Object> buildAttributes(java.lang.String providerName, OpenIdTokenResponse tokenResponse, OpenIdClaims openIdClaims)
providerName
- The OpenID provider nametokenResponse
- The token responseopenIdClaims
- The OpenID claimsUserDetails
protected java.util.List<java.lang.String> getRoles(java.lang.String providerName, OpenIdTokenResponse tokenResponse, OpenIdClaims openIdClaims)
providerName
- The OpenID provider nametokenResponse
- The token responseopenIdClaims
- The OpenID claimsUserDetails
protected java.lang.String getUsername(java.lang.String providerName, OpenIdTokenResponse tokenResponse, OpenIdClaims openIdClaims)
providerName
- The OpenID provider nametokenResponse
- The token responseopenIdClaims
- The OpenID claimsUserDetails