@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)
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) |
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) |
public DefaultOpenIdUserDetailsMapper(OpenIdAdditionalClaimsConfiguration openIdAdditionalClaimsConfiguration)
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 claimsprotected 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