Class OAuth2UserInfo
java.lang.Object
com.alpaca.security.oauth2.userinfo.OAuth2UserInfo
- Direct Known Subclasses:
GoogleUserInfo
Abstract base class representing OAuth2 user information from a provider.
This class serves as a contract for provider-specific implementations (e.g., GoogleUserInfo), defining common accessors for user attributes retrieved from OAuth2 providers.
Subclasses are expected to implement methods to extract essential user data:
getId(): unique user identifiergetFullName()/getFirstName()/getLastName(): name detailsgetEmail()andgetEmailVerified(): email and verification statusgetImageUrl(): profile image URL
Map and made accessible to subclasses
for extraction.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe raw attributes received from the OAuth2 provider. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StringgetEmail()Returns the user's email addressabstract booleanReturns true if the user's email is verified; false otherwiseabstract StringReturns the user's first nameabstract StringReturns the full name of the userabstract StringgetId()Returns the provider-specific unique identifier for the userabstract StringReturns the URL of the user's profile imageabstract StringReturns the user's last name
-
Field Details
-
attributes
The raw attributes received from the OAuth2 provider. Subclasses use this map to extract provider-specific values.
-
-
Constructor Details
-
OAuth2UserInfo
public OAuth2UserInfo()
-
-
Method Details
-
getId
Returns the provider-specific unique identifier for the user -
getFullName
Returns the full name of the user -
getFirstName
Returns the user's first name -
getLastName
Returns the user's last name -
getEmail
Returns the user's email address -
getImageUrl
Returns the URL of the user's profile image -
getEmailVerified
public abstract boolean getEmailVerified()Returns true if the user's email is verified; false otherwise
-