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_basicby default.clientId- identifier of the client,service-clientby default.clientSecret- shared secret ofclient_secret_basic; empty for the other methods.tokenUri- token endpoint,http://localhost:9000/oauth2/tokenby default.scopes- scopes requested,documents.readby default.refreshBefore- how long before its expiry a cached access token is renewed,PT60Sby 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 Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for theclientIdrecord component.private final StringThe field for theclientSecretrecord component.static final StringClient identifier used when nothing is configured.static final longSeconds before the expiry of a token at which it is renewed, when nothing is configured.static final StringScope requested when nothing is configured.static final URIToken endpoint used when nothing is configured.private final booleanThe field for thedpoprecord component.private final AuthMethodThe field for themethodrecord component.private final DurationThe field for therefreshBeforerecord component.The field for thescopesrecord component.private final StringThe field for thesslBundlerecord component.private final URIThe field for thetokenUrirecord component. -
Constructor Summary
ConstructorsConstructorDescriptionServiceClientAuthProperties(AuthMethod method, String clientId, String clientSecret, URI tokenUri, List<String> scopes, Duration refreshBefore, boolean dpop, String sslBundle) Applies the defaults and validates the values. -
Method Summary
Modifier and TypeMethodDescriptionclientId()Returns the value of theclientIdrecord component.Returns the value of theclientSecretrecord component.booleandpop()Returns the value of thedpoprecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.method()Returns the value of themethodrecord component.Returns the value of therefreshBeforerecord component.scopes()Returns the value of thescopesrecord component.Returns the value of thesslBundlerecord component.tokenUri()Returns the value of thetokenUrirecord component.toString()Describes the settings without the secret.
-
Field Details
-
method
The field for themethodrecord component. -
clientId
The field for theclientIdrecord component. -
clientSecret
The field for theclientSecretrecord component. -
tokenUri
The field for thetokenUrirecord component. -
scopes
The field for thescopesrecord component. -
refreshBefore
The field for therefreshBeforerecord component. -
dpop
private final boolean dpopThe field for thedpoprecord component. -
sslBundle
The field for thesslBundlerecord component. -
DEFAULT_CLIENT_ID
Client identifier used when nothing is configured.- See Also:
-
DEFAULT_TOKEN_URI
Token endpoint used when nothing is configured. -
DEFAULT_SCOPE
Scope requested when nothing is configured.- See Also:
-
DEFAULT_REFRESH_BEFORE_SECONDS
public static final long DEFAULT_REFRESH_BEFORE_SECONDSSeconds before the expiry of a token at which it is renewed, when nothing is configured.- See Also:
-
-
Constructor Details
-
ServiceClientAuthProperties
public ServiceClientAuthProperties(AuthMethod method, String clientId, String clientSecret, URI tokenUri, List<String> scopes, Duration refreshBefore, boolean dpop, String sslBundle) Applies the defaults and validates the values.- Throws:
IllegalArgumentException- if the refresh margin is negative.
-
-
Method Details
-
toString
Describes the settings without the secret. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
clientId
Returns the value of theclientIdrecord component.- Returns:
- the value of the
clientIdrecord component
-
clientSecret
Returns the value of theclientSecretrecord component.- Returns:
- the value of the
clientSecretrecord component
-
tokenUri
Returns the value of thetokenUrirecord component.- Returns:
- the value of the
tokenUrirecord component
-
scopes
Returns the value of thescopesrecord component.- Returns:
- the value of the
scopesrecord component
-
refreshBefore
Returns the value of therefreshBeforerecord component.- Returns:
- the value of the
refreshBeforerecord component
-
dpop
public boolean dpop()Returns the value of thedpoprecord component.- Returns:
- the value of the
dpoprecord component
-
sslBundle
Returns the value of thesslBundlerecord component.- Returns:
- the value of the
sslBundlerecord component
-