public class NimbusOAuth2UserService extends java.lang.Object implements OAuth2UserService
OAuth2UserService
that uses the Nimbus OAuth 2.0 SDK internally.
This implementation may be configured with a Map
of custom OAuth2User
types
keyed by URI
, which represents the UserInfo Endpoint address.
For OAuth2User
's registered at a standard OAuth 2.0 Provider, the attribute name
for the "user's name" is required. This can be supplied via setUserNameAttributeNames(Map)
,
keyed by URI
, which represents the UserInfo Endpoint address.
OAuth2AuthenticationToken
,
OAuth2User
,
OidcUser
,
UserInfo
,
Nimbus OAuth 2.0 SDKConstructor and Description |
---|
NimbusOAuth2UserService() |
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.net.URI,java.lang.Class<? extends OAuth2User>> |
getCustomUserTypes() |
protected java.util.Map<java.lang.String,java.lang.Object> |
getUserInfo(OAuth2AuthenticationToken token) |
protected java.util.Map<java.net.URI,java.lang.String> |
getUserNameAttributeNames() |
protected OAuth2User |
loadCustomUser(OAuth2AuthenticationToken token) |
protected OAuth2User |
loadOAuth2User(OAuth2AuthenticationToken token) |
protected OAuth2User |
loadOidcUser(OAuth2AuthenticationToken token) |
OAuth2User |
loadUser(OAuth2AuthenticationToken token) |
void |
setCustomUserTypes(java.util.Map<java.net.URI,java.lang.Class<? extends OAuth2User>> customUserTypes) |
void |
setUserNameAttributeNames(java.util.Map<java.net.URI,java.lang.String> userNameAttributeNames) |
public final OAuth2User loadUser(OAuth2AuthenticationToken token) throws OAuth2AuthenticationException
loadUser
in interface OAuth2UserService
OAuth2AuthenticationException
protected OAuth2User loadOidcUser(OAuth2AuthenticationToken token) throws OAuth2AuthenticationException
OAuth2AuthenticationException
protected OAuth2User loadOAuth2User(OAuth2AuthenticationToken token) throws OAuth2AuthenticationException
OAuth2AuthenticationException
protected OAuth2User loadCustomUser(OAuth2AuthenticationToken token) throws OAuth2AuthenticationException
OAuth2AuthenticationException
protected java.util.Map<java.lang.String,java.lang.Object> getUserInfo(OAuth2AuthenticationToken token) throws OAuth2AuthenticationException
OAuth2AuthenticationException
protected java.util.Map<java.net.URI,java.lang.String> getUserNameAttributeNames()
public final void setUserNameAttributeNames(java.util.Map<java.net.URI,java.lang.String> userNameAttributeNames)
protected java.util.Map<java.net.URI,java.lang.Class<? extends OAuth2User>> getCustomUserTypes()
public final void setCustomUserTypes(java.util.Map<java.net.URI,java.lang.Class<? extends OAuth2User>> customUserTypes)