Class DefaultClientDefinitions
java.lang.Object
com.irurueta.authserver.authorization.application.clients.DefaultClientDefinitions
The single definition of the clients a deployment can start with: the confidential
bff (backend for
frontend) and the public spa-public. Used by the seeder and by the development data initializer, so they
never drift apart. Nothing environment-specific lives here: the redirect URIs come from configuration (the
dev profile supplies the local ones) and so does the audience of the authorization server's own API. Both
clients carry the audience of the resource server and of that API (so a user can change their password through
them), may read and delete documents, and never get the admin scope.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final DurationLifetime of access tokens.static final StringClient id of the backend for frontend.static final StringDefault audience of the authorization server's own REST API (authserver.api.audience).private static final DurationLifetime of refresh tokens.static final StringAudience of the resource server.Scopes of both default clients.static final StringClient id of the public single-page application.static final StringGrant type URN of the OAuth 2.0 token exchange (RFC 8693) that a client needs to exchange tokens. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClientRegistrationDefines thebffclient: confidential,client_secret_basic, authorization code with PKCE and refresh tokens, with refresh token rotation on.static ClientRegistrationDefines thebffclient with the URIs it may be sent to after an OpenID Connect RP-initiated logout.static ClientRegistrationDefines thespa-publicclient: public, authorization code with PKCE, no client authentication.static ClientRegistrationDefines thespa-publicclient with the URIs it may be sent to after an OpenID Connect RP-initiated logout.
-
Field Details
-
BFF_CLIENT_ID
Client id of the backend for frontend.- See Also:
-
SPA_PUBLIC_CLIENT_ID
Client id of the public single-page application.- See Also:
-
RESOURCE_SERVER_AUDIENCE
Audience of the resource server.- See Also:
-
TOKEN_EXCHANGE_GRANT
Grant type URN of the OAuth 2.0 token exchange (RFC 8693) that a client needs to exchange tokens.- See Also:
-
DEFAULT_API_AUDIENCE
Default audience of the authorization server's own REST API (authserver.api.audience).- See Also:
-
SCOPES
Scopes of both default clients. -
ACCESS_TOKEN_TTL
Lifetime of access tokens. -
REFRESH_TOKEN_TTL
Lifetime of refresh tokens.
-
-
Constructor Details
-
DefaultClientDefinitions
private DefaultClientDefinitions()Not instantiable.
-
-
Method Details
-
bff
Defines thebffclient: confidential,client_secret_basic, authorization code with PKCE and refresh tokens, with refresh token rotation on. It requires the end-user's consent to the requested scopes.- Parameters:
redirectUris- redirect URIs of the deployment.apiAudience- audience of the authorization server's own API.- Returns:
- the client.
-
bff
public static ClientRegistration bff(List<String> redirectUris, String apiAudience, List<String> postLogoutRedirectUris) Defines thebffclient with the URIs it may be sent to after an OpenID Connect RP-initiated logout.- Parameters:
redirectUris- redirect URIs of the deployment.apiAudience- audience of the authorization server's own API.postLogoutRedirectUris- post-logout redirect URIs of the deployment; none when empty.- Returns:
- the client.
-
spaPublic
Defines thespa-publicclient: public, authorization code with PKCE, no client authentication.- Parameters:
redirectUris- redirect URIs of the deployment.apiAudience- audience of the authorization server's own API.- Returns:
- the client.
-
spaPublic
public static ClientRegistration spaPublic(List<String> redirectUris, String apiAudience, List<String> postLogoutRedirectUris) Defines thespa-publicclient with the URIs it may be sent to after an OpenID Connect RP-initiated logout.- Parameters:
redirectUris- redirect URIs of the deployment.apiAudience- audience of the authorization server's own API.postLogoutRedirectUris- post-logout redirect URIs of the deployment; none when empty.- Returns:
- the client.
-