public class OidcUserService extends java.lang.Object implements OAuth2UserService<OidcUserRequest,org.springframework.security.oauth2.core.oidc.user.OidcUser>
OAuth2UserService that supports OpenID Connect 1.0
Provider's.OAuth2UserService,
OidcUserRequest,
OidcUser,
DefaultOidcUser,
OidcUserInfo| Constructor and Description |
|---|
OidcUserService() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.lang.String,org.springframework.core.convert.converter.Converter<java.lang.Object,?>> |
createDefaultClaimTypeConverters()
Returns the default
Converter's used for type conversion of claim values
for an OidcUserInfo. |
org.springframework.security.oauth2.core.oidc.user.OidcUser |
loadUser(OidcUserRequest userRequest)
Returns an
OAuth2User after obtaining the user attributes of the End-User
from the UserInfo Endpoint. |
void |
setAccessibleScopes(java.util.Set<java.lang.String> accessibleScopes)
Sets the scope(s) that allow access to the user info resource.
|
void |
setClaimTypeConverterFactory(java.util.function.Function<ClientRegistration,org.springframework.core.convert.converter.Converter<java.util.Map<java.lang.String,java.lang.Object>,java.util.Map<java.lang.String,java.lang.Object>>> claimTypeConverterFactory)
Sets the factory that provides a
Converter used for type conversion of
claim values for an OidcUserInfo. |
void |
setOauth2UserService(OAuth2UserService<OAuth2UserRequest,org.springframework.security.oauth2.core.user.OAuth2User> oauth2UserService)
Sets the
OAuth2UserService used when requesting the user info resource. |
public static java.util.Map<java.lang.String,org.springframework.core.convert.converter.Converter<java.lang.Object,?>> createDefaultClaimTypeConverters()
Converter's used for type conversion of claim values
for an OidcUserInfo.Map of Converter's keyed by claim namepublic org.springframework.security.oauth2.core.oidc.user.OidcUser loadUser(OidcUserRequest userRequest) throws org.springframework.security.oauth2.core.OAuth2AuthenticationException
OAuth2UserServiceOAuth2User after obtaining the user attributes of the End-User
from the UserInfo Endpoint.loadUser in interface OAuth2UserService<OidcUserRequest,org.springframework.security.oauth2.core.oidc.user.OidcUser>userRequest - the user requestOAuth2Userorg.springframework.security.oauth2.core.OAuth2AuthenticationException - if an error occurs while attempting to obtain
the user attributes from the UserInfo Endpointpublic final void setOauth2UserService(OAuth2UserService<OAuth2UserRequest,org.springframework.security.oauth2.core.user.OAuth2User> oauth2UserService)
OAuth2UserService used when requesting the user info resource.oauth2UserService - the OAuth2UserService used when requesting the
user info resource.public final void setClaimTypeConverterFactory(java.util.function.Function<ClientRegistration,org.springframework.core.convert.converter.Converter<java.util.Map<java.lang.String,java.lang.Object>,java.util.Map<java.lang.String,java.lang.Object>>> claimTypeConverterFactory)
Converter used for type conversion of
claim values for an OidcUserInfo. The default is ClaimTypeConverter
for all clients.claimTypeConverterFactory - the factory that provides a Converter used
for type conversion of claim values for a specific clientpublic final void setAccessibleScopes(java.util.Set<java.lang.String> accessibleScopes)
profile, email,
address and phone. The scope(s)
are checked against the "granted" scope(s) associated to the
access token to determine if the user info
resource is accessible or not. If there is at least one match, the user info
resource will be requested, otherwise it will not.accessibleScopes - the scope(s) that allow access to the user info resource