Class OAuth2UserAuthority
- java.lang.Object
-
- org.springframework.security.oauth2.core.user.OAuth2UserAuthority
-
- All Implemented Interfaces:
java.io.Serializable,org.springframework.security.core.GrantedAuthority
- Direct Known Subclasses:
OidcUserAuthority
public class OAuth2UserAuthority extends java.lang.Object implements org.springframework.security.core.GrantedAuthorityAGrantedAuthoritythat may be associated to anOAuth2User.- Since:
- 5.0
- See Also:
OAuth2User, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OAuth2UserAuthority(java.lang.String authority, java.util.Map<java.lang.String,java.lang.Object> attributes)Constructs aOAuth2UserAuthorityusing the provided parameters.OAuth2UserAuthority(java.util.Map<java.lang.String,java.lang.Object> attributes)Constructs aOAuth2UserAuthorityusing the provided parameters and defaultsgetAuthority()toROLE_USER.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.util.Map<java.lang.String,java.lang.Object>getAttributes()Returns the attributes about the user.java.lang.StringgetAuthority()inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
OAuth2UserAuthority
public OAuth2UserAuthority(java.util.Map<java.lang.String,java.lang.Object> attributes)
Constructs aOAuth2UserAuthorityusing the provided parameters and defaultsgetAuthority()toROLE_USER.- Parameters:
attributes- the attributes about the user
-
OAuth2UserAuthority
public OAuth2UserAuthority(java.lang.String authority, java.util.Map<java.lang.String,java.lang.Object> attributes)Constructs aOAuth2UserAuthorityusing the provided parameters.- Parameters:
authority- the authority granted to the userattributes- the attributes about the user
-
-
Method Detail
-
getAuthority
public java.lang.String getAuthority()
- Specified by:
getAuthorityin interfaceorg.springframework.security.core.GrantedAuthority
-
getAttributes
public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Returns the attributes about the user.- Returns:
- a
Mapof attributes about the user
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-