Class DefaultOAuth2User

java.lang.Object
org.springframework.security.oauth2.core.user.DefaultOAuth2User
All Implemented Interfaces:
Serializable, AuthenticatedPrincipal, OAuth2AuthenticatedPrincipal, OAuth2User
Direct Known Subclasses:
DefaultOidcUser

public class DefaultOAuth2User extends Object implements OAuth2User, Serializable
The default implementation of an OAuth2User.

User attribute names are not standardized between providers and therefore it is required to supply the key for the user's "name" attribute to one of the constructors. The key will be used for accessing the "name" of the Principal (user) via getAttributes() and returning it from getName().

Since:
5.0
See Also: