Record Class LegacyImplicitProperties

java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.api.web.implicit.LegacyImplicitProperties
Record Components:
clientId - identifier of the only client that may use the flow.
redirectUri - the only redirect URI of that client.
scopes - scopes the client may request.
audience - audience of the access tokens it gets.
accessTokenTtl - lifetime of the access tokens, at most MAX_ACCESS_TOKEN_TTL.

@ConfigurationProperties(prefix="authserver.legacy-implicit") public record LegacyImplicitProperties(String clientId, String redirectUri, List<String> scopes, String audience, Duration accessTokenTtl) extends Record
Settings of the legacy implicit flow, bound from authserver.legacy-implicit.* (see application-legacy-implicit.yml). The flow exists only to show why OAuth 2.1 removed it, so it is limited to one client, one redirect URI, a restricted audience and scope, and a short lifetime.
  • Field Details

    • clientId

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

      private final String redirectUri
      The field for the redirectUri record component.
    • scopes

      private final List<String> scopes
      The field for the scopes record component.
    • audience

      private final String audience
      The field for the audience record component.
    • accessTokenTtl

      private final Duration accessTokenTtl
      The field for the accessTokenTtl record component.
    • MAX_ACCESS_TOKEN_TTL

      public static final Duration MAX_ACCESS_TOKEN_TTL
      Longest lifetime an access token of the legacy flow may have.
  • Constructor Details

    • LegacyImplicitProperties

      public LegacyImplicitProperties(@DefaultValue("legacy-implicit-spa") String clientId, String redirectUri, @DefaultValue("documents.read") List<String> scopes, @DefaultValue("resource-server") String audience, @DefaultValue("PT5M") Duration accessTokenTtl)
      Validates the settings and defensively copies the scopes.
      Throws:
      IllegalArgumentException - if the client id, redirect URI or audience is blank, the scopes are missing, empty or contain a blank value, or the lifetime is missing, not positive or longer than MAX_ACCESS_TOKEN_TTL.
  • Method Details

    • requireText

      private static void requireText(String value, String name)
      Refuses a blank text.
      Parameters:
      value - the value.
      name - its name, for the message.
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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
    • redirectUri

      public String redirectUri()
      Returns the value of the redirectUri record component.
      Returns:
      the value of the redirectUri record component
    • scopes

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

      public String audience()
      Returns the value of the audience record component.
      Returns:
      the value of the audience record component
    • accessTokenTtl

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