public class OAuth2UserAuthority extends java.lang.Object implements GrantedAuthority
GrantedAuthority that may be associated to an OAuth2User.OAuth2User,
Serialized Form| Constructor and Description |
|---|
OAuth2UserAuthority(java.util.Map<java.lang.String,java.lang.Object> attributes)
Constructs a
OAuth2UserAuthority using the provided parameters
and defaults getAuthority() to ROLE_USER. |
OAuth2UserAuthority(java.lang.String authority,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Constructs a
OAuth2UserAuthority using the provided parameters. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Returns the attributes about the user.
|
java.lang.String |
getAuthority()
If the
GrantedAuthority can be represented as a String
and that String is sufficient in precision to be relied upon for an
access control decision by an AccessDecisionManager (or delegate), this
method should return such a String. |
int |
hashCode() |
java.lang.String |
toString() |
public OAuth2UserAuthority(java.util.Map<java.lang.String,java.lang.Object> attributes)
OAuth2UserAuthority using the provided parameters
and defaults getAuthority() to ROLE_USER.attributes - the attributes about the userpublic OAuth2UserAuthority(java.lang.String authority,
java.util.Map<java.lang.String,java.lang.Object> attributes)
OAuth2UserAuthority using the provided parameters.authority - the authority granted to the userattributes - the attributes about the userpublic java.lang.String getAuthority()
GrantedAuthorityGrantedAuthority can be represented as a String
and that String is sufficient in precision to be relied upon for an
access control decision by an AccessDecisionManager (or delegate), this
method should return such a String.
If the GrantedAuthority cannot be expressed with sufficient precision
as a String, null should be returned. Returning
null will require an AccessDecisionManager (or delegate)
to specifically support the GrantedAuthority implementation, so
returning null should be avoided unless actually required.
getAuthority in interface GrantedAuthoritynull if the
granted authority cannot be expressed as a String with sufficient
precision).public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Map of attributes about the userpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object