Class DefaultOAuth2AuthenticatedPrincipal
java.lang.Object
org.springframework.security.oauth2.core.DefaultOAuth2AuthenticatedPrincipal
- All Implemented Interfaces:
Serializable
,AuthenticatedPrincipal
,OAuth2AuthenticatedPrincipal
public final class DefaultOAuth2AuthenticatedPrincipal
extends Object
implements OAuth2AuthenticatedPrincipal, Serializable
A domain object that wraps the attributes of an OAuth 2.0 token.
- Since:
- 5.2
- See Also:
-
Constructor Summary
ConstructorDescriptionDefaultOAuth2AuthenticatedPrincipal
(String name, Map<String, Object> attributes, Collection<GrantedAuthority> authorities) Constructs anDefaultOAuth2AuthenticatedPrincipal
using the provided parameters.DefaultOAuth2AuthenticatedPrincipal
(Map<String, Object> attributes, Collection<GrantedAuthority> authorities) Constructs anDefaultOAuth2AuthenticatedPrincipal
using the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionGets the attributes of the OAuth 2.0 token in map form.Collection<? extends GrantedAuthority>
Get theCollection
ofGrantedAuthority
s associated with this OAuth 2.0 tokengetName()
Returns the name of the authenticatedPrincipal
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal
getAttribute
-
Constructor Details
-
DefaultOAuth2AuthenticatedPrincipal
public DefaultOAuth2AuthenticatedPrincipal(Map<String, Object> attributes, Collection<GrantedAuthority> authorities) Constructs anDefaultOAuth2AuthenticatedPrincipal
using the provided parameters.- Parameters:
attributes
- the attributes of the OAuth 2.0 tokenauthorities
- the authorities of the OAuth 2.0 token
-
DefaultOAuth2AuthenticatedPrincipal
public DefaultOAuth2AuthenticatedPrincipal(String name, Map<String, Object> attributes, Collection<GrantedAuthority> authorities) Constructs anDefaultOAuth2AuthenticatedPrincipal
using the provided parameters.- Parameters:
name
- the name attached to the OAuth 2.0 tokenattributes
- the attributes of the OAuth 2.0 tokenauthorities
- the authorities of the OAuth 2.0 token
-
-
Method Details
-
getAttributes
Gets the attributes of the OAuth 2.0 token in map form.- Specified by:
getAttributes
in interfaceOAuth2AuthenticatedPrincipal
- Returns:
- a
Map
of the attribute's objects keyed by the attribute's names
-
getAuthorities
Description copied from interface:OAuth2AuthenticatedPrincipal
Get theCollection
ofGrantedAuthority
s associated with this OAuth 2.0 token- Specified by:
getAuthorities
in interfaceOAuth2AuthenticatedPrincipal
- Returns:
- the OAuth 2.0 token authorities
-
getName
Description copied from interface:AuthenticatedPrincipal
Returns the name of the authenticatedPrincipal
. Nevernull
.- Specified by:
getName
in interfaceAuthenticatedPrincipal
- Returns:
- the name of the authenticated
Principal
-