Record Class ServiceClientAuthProperties

java.lang.Object
java.lang.Record
com.irurueta.authserver.serviceclient.infrastructure.resourceserver.ServiceClientAuthProperties
Record Components:
method - how the client authenticates, client_secret_basic by default.
clientId - identifier of the client, service-client by default.
clientSecret - shared secret of client_secret_basic; empty for the other methods.
tokenUri - token endpoint, http://localhost:9000/oauth2/token by default.
scopes - scopes requested, documents.read by default.
refreshBefore - how long before its expiry a cached access token is renewed, PT60S by default.
dpop - whether tokens are bound to a proof-of-possession key (RFC 9449).
sslBundle - name of the Spring Boot SSL bundle that holds the client certificate and the trust material; needed by the mutual TLS methods (it is also used for the calls to the resource server), and used by the other methods only when set.

@ConfigurationProperties(prefix="service-client.auth") public record ServiceClientAuthProperties(AuthMethod method, String clientId, String clientSecret, URI tokenUri, List<String> scopes, Duration refreshBefore, boolean dpop, String sslBundle) extends Record
Settings of the service client at the authorization server (service-client.auth.*). Every one has a default so that the application starts under any profile; the CLI profiles supply the real values.
  • Field Details

    • method

      private final AuthMethod method
      The field for the method record component.
    • clientId

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

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

      private final URI tokenUri
      The field for the tokenUri record component.
    • scopes

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

      private final Duration refreshBefore
      The field for the refreshBefore record component.
    • dpop

      private final boolean dpop
      The field for the dpop record component.
    • sslBundle

      private final String sslBundle
      The field for the sslBundle record component.
    • DEFAULT_CLIENT_ID

      public static final String DEFAULT_CLIENT_ID
      Client identifier used when nothing is configured.
      See Also:
    • DEFAULT_TOKEN_URI

      public static final URI DEFAULT_TOKEN_URI
      Token endpoint used when nothing is configured.
    • DEFAULT_SCOPE

      public static final String DEFAULT_SCOPE
      Scope requested when nothing is configured.
      See Also:
    • DEFAULT_REFRESH_BEFORE_SECONDS

      public static final long DEFAULT_REFRESH_BEFORE_SECONDS
      Seconds before the expiry of a token at which it is renewed, when nothing is configured.
      See Also:
  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Describes the settings without the secret.
      Specified by:
      toString in class Record
      Returns:
      the description.
    • 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.
    • method

      public AuthMethod method()
      Returns the value of the method record component.
      Returns:
      the value of the method record component
    • 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
    • tokenUri

      public URI tokenUri()
      Returns the value of the tokenUri record component.
      Returns:
      the value of the tokenUri record component
    • scopes

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

      public Duration refreshBefore()
      Returns the value of the refreshBefore record component.
      Returns:
      the value of the refreshBefore record component
    • dpop

      public boolean dpop()
      Returns the value of the dpop record component.
      Returns:
      the value of the dpop record component
    • sslBundle

      public String sslBundle()
      Returns the value of the sslBundle record component.
      Returns:
      the value of the sslBundle record component