@Singleton @Requires(configuration="io.micronaut.security.token.jwt") public class DefaultOpenIdAuthenticationMapper extends java.lang.Object implements OpenIdAuthenticationMapper
OpenIdAuthenticationMapper
that uses
the subject claim for the username and populates the attributes with the
non JWT standard claims. If an OpenIdAuthenticationMapper
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 |
---|
DefaultOpenIdAuthenticationMapper(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) |
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) |
public DefaultOpenIdAuthenticationMapper(OpenIdAdditionalClaimsConfiguration openIdAdditionalClaimsConfiguration, AuthenticationModeConfiguration authenticationModeConfiguration)
openIdAdditionalClaimsConfiguration
- The additional claims configurationauthenticationModeConfiguration
- Authentication Mode Configuration@NonNull public AuthenticationResponse createAuthenticationResponse(java.lang.String providerName, OpenIdTokenResponse tokenResponse, OpenIdClaims openIdClaims, @Nullable State state)
createAuthenticationResponse
in interface OpenIdAuthenticationMapper
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 claimsAuthentication
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 claimsAuthentication
protected java.lang.String getUsername(java.lang.String providerName, OpenIdTokenResponse tokenResponse, OpenIdClaims openIdClaims)
providerName
- The OpenID provider nametokenResponse
- The token responseopenIdClaims
- The OpenID claimsAuthentication