Record Class SocialProperties.Provider

java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.api.web.social.SocialProperties.Provider
Record Components:
clientId - client id registered with the provider; blank leaves the provider disabled.
clientSecret - client secret (Google, Microsoft, GitHub), supplied from the environment.
trustMfa - whether the provider's amr claim is trusted to prove several factors (default false).
tenant - Entra ID tenant: common (the default), organizations, consumers, or a tenant id or domain.
allowedTenants - tenant ids an Entra ID multi-tenant sign-in is limited to; empty accepts any tenant.
teamId - Apple developer team id.
keyId - id of the Apple key the client secret is signed with.
privateKey - PKCS#8 PEM private key (ES256) Apple issued, supplied from the environment; a literal \n stands for a line break.
clientSecretTtl - lifetime of the client secret JWT sent to Apple (default five minutes, at most six months).
Enclosing class:
SocialProperties

public static record SocialProperties.Provider(String clientId, String clientSecret, boolean trustMfa, String tenant, List<String> allowedTenants, String teamId, String keyId, String privateKey, Duration clientSecretTtl) extends Record
Settings of one provider. Only the ones that apply to the provider are read: the client secret by Google, Microsoft and GitHub, the tenant settings by Microsoft and the key settings by Apple (whose client secret is a JWT signed with the private key).
  • Field Details

    • clientId

      private final String clientId
      The field for the clientId record component.
    • clientSecret

      private final String clientSecret
      The field for the clientSecret record component.
    • trustMfa

      private final boolean trustMfa
      The field for the trustMfa record component.
    • tenant

      private final String tenant
      The field for the tenant record component.
    • allowedTenants

      private final List<String> allowedTenants
      The field for the allowedTenants record component.
    • teamId

      private final String teamId
      The field for the teamId record component.
    • keyId

      private final String keyId
      The field for the keyId record component.
    • privateKey

      private final String privateKey
      The field for the privateKey record component.
    • clientSecretTtl

      private final Duration clientSecretTtl
      The field for the clientSecretTtl record component.
  • Constructor Details

    • Provider

      public Provider(String clientId, String clientSecret, boolean trustMfa, @DefaultValue("common") String tenant, List<String> allowedTenants, String teamId, String keyId, String privateKey, @DefaultValue("PT5M") Duration clientSecretTtl)
      Copies the tenants and fills the defaults of the unbound settings.
  • Method Details

    • permittedTenants

      public List<String> permittedTenants()
      Returns the tenants an Entra ID sign-in is limited to: the configured list, else the tenant itself when it is a tenant id, else none, which means any tenant (a multi-tenant application, or a tenant given by domain name, whose tokens carry its id).
      Returns:
      the permitted tenant ids; empty accepts any tenant.
    • enabled

      public boolean enabled()
      Tells whether the provider is enabled.
      Returns:
      true when the client id has text.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • clientId

      public String clientId()
      Returns the value of the clientId record component.
      Returns:
      the value of the clientId record component
    • clientSecret

      public String clientSecret()
      Returns the value of the clientSecret record component.
      Returns:
      the value of the clientSecret record component
    • trustMfa

      public boolean trustMfa()
      Returns the value of the trustMfa record component.
      Returns:
      the value of the trustMfa record component
    • tenant

      public String tenant()
      Returns the value of the tenant record component.
      Returns:
      the value of the tenant record component
    • allowedTenants

      public List<String> allowedTenants()
      Returns the value of the allowedTenants record component.
      Returns:
      the value of the allowedTenants record component
    • teamId

      public String teamId()
      Returns the value of the teamId record component.
      Returns:
      the value of the teamId record component
    • keyId

      public String keyId()
      Returns the value of the keyId record component.
      Returns:
      the value of the keyId record component
    • privateKey

      public String privateKey()
      Returns the value of the privateKey record component.
      Returns:
      the value of the privateKey record component
    • clientSecretTtl

      public Duration clientSecretTtl()
      Returns the value of the clientSecretTtl record component.
      Returns:
      the value of the clientSecretTtl record component