Class OAuth2UserInfo

java.lang.Object
com.alpaca.security.oauth2.userinfo.OAuth2UserInfo
Direct Known Subclasses:
GoogleUserInfo

public abstract class OAuth2UserInfo extends Object
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 identifier
  • getFullName() / getFirstName() / getLastName(): name details
  • getEmail() and getEmailVerified(): email and verification status
  • getImageUrl(): profile image URL
The raw provider attributes are encapsulated in a Map and made accessible to subclasses for extraction.
See Also:
  • Field Details

    • attributes

      protected Map<String,Object> 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

      public abstract String getId()
      Returns the provider-specific unique identifier for the user
    • getFullName

      public abstract String getFullName()
      Returns the full name of the user
    • getFirstName

      public abstract String getFirstName()
      Returns the user's first name
    • getLastName

      public abstract String getLastName()
      Returns the user's last name
    • getEmail

      public abstract String getEmail()
      Returns the user's email address
    • getImageUrl

      public abstract String 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