Enum Class OAuthAttributes

java.lang.Object
java.lang.Enum<OAuthAttributes>
com.lpvs.entity.enums.OAuthAttributes
All Implemented Interfaces:
Serializable, Comparable<OAuthAttributes>, Constable

public enum OAuthAttributes extends Enum<OAuthAttributes>
Enum representing OAuth attributes for various providers. Each constant in this enum corresponds to an OAuth provider, providing a way to extract attributes and create a MemberProfile.
  • Enum Constant Details

    • GOOGLE

      public static final OAuthAttributes GOOGLE
      Represents OAuth attributes for Google authentication.
    • KAKAO

      public static final OAuthAttributes KAKAO
      Represents OAuth attributes for Kakao authentication.
    • GITHUB

      public static final OAuthAttributes GITHUB
      Represents OAuth attributes for GitHub authentication.
  • Method Details

    • values

      public static OAuthAttributes[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static OAuthAttributes valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • extract

      public static MemberProfile extract(String registrationId, Map<String,Object> attributes)
      Extracts OAuth attributes based on the registration ID and creates a MemberProfile.
      Parameters:
      registrationId - The registration ID associated with the OAuth provider.
      attributes - The map of OAuth attributes.
      Returns:
      A MemberProfile created from the extracted OAuth attributes.
      Throws:
      IllegalArgumentException - if no matching OAuthAttributes is found for the given registrationId.