Enum Class IdentityProvider

java.lang.Object
java.lang.Enum<IdentityProvider>
com.irurueta.authserver.authorization.domain.social.IdentityProvider
All Implemented Interfaces:
Serializable, Comparable<IdentityProvider>, Constable

public enum IdentityProvider extends Enum<IdentityProvider>
External identity providers an account can be linked to. The identifier is the registration id of the provider in the configuration (authserver.social.providers.<id>) and the value stored with every link.
  • Enum Constant Details

    • GOOGLE

      public static final IdentityProvider GOOGLE
      Google, an OpenID Connect provider.
    • MICROSOFT

      public static final IdentityProvider MICROSOFT
      Microsoft Entra ID, an OpenID Connect provider with a multi-tenant issuer.
    • APPLE

      public static final IdentityProvider APPLE
      Sign in with Apple, an OpenID Connect provider whose client secret is a signed JWT.
    • GITHUB

      public static final IdentityProvider GITHUB
      GitHub, a plain OAuth 2.0 provider.
  • Field Details

    • id

      private final String id
      Registration id of the provider, in lower case.
  • Constructor Details

    • IdentityProvider

      private IdentityProvider(String id)
      Creates a provider.
      Parameters:
      id - registration id of the provider.
  • Method Details

    • values

      public static IdentityProvider[] 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 IdentityProvider 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
    • id

      public String id()
      Returns the registration id of the provider.
      Returns:
      the lower case registration id.
    • fromId

      public static Optional<IdentityProvider> fromId(String id)
      Finds a provider by its registration id.
      Parameters:
      id - registration id, compared exactly.
      Returns:
      the provider, or an empty optional when the id is null or unknown.