10Duke Java Core
Loading...
Searching...
No Matches
tenduke.sdk.core.model.config.AuthConfigWithFallback Class Reference

Detailed Description

A AuthConfig implementation that provides a stacked approach for supporting a multi-source configuration.

To define a stacked configuration instance that terminates the recursion use: the single argument constructor OR call only the fluent variant withPriorityConfig without a further call to withFallbackConfig.

Inheritance diagram for tenduke.sdk.core.model.config.AuthConfigWithFallback:
tenduke.sdk.core.model.config.AbstractConfigWithFallback< AuthConfig > tenduke.sdk.core.model.config.AuthConfig tenduke.sdk.core.model.config.HttpClientConfig tenduke.sdk.core.model.config.Configuration

Public Member Functions

 AuthConfigWithFallback (final AuthConfig config, final AuthConfig fallback)
 Creates a new instance with the given primary and fallback configuration objects.
 
AuthConfigWithFallback withConfig (final AuthConfig config)
 
AuthConfigWithFallback withFallbackConfig (final AuthConfig config)
 
Optional< String > tokenPath ()
 Directory path for storing token data, e.g.JSON Web Tokens (JWT's). Defaults to: "./local-config".
Returns
A file system path where tokens are stored.

 
Optional< String > publicKeyPath ()
 Directory path for storing public keys.Defaults to: "./local-config".
Returns
A file system path where public keys are stored.

 
Optional< URI > idpOidcDiscoveryUrl ()
 Used to retrieve the details of the Open ID Connect endpoints for the identity provider.Defaults to: empty (no URI configured).
Returns
The URL to use for loading OpenID Connect settings.

 
Optional< URI > idpOauthAuthorizationUrl ()
 Endpoint for Authorization Request in Authorization Code or Implicit Grant flows (may be omitted if idpOidcDiscoveryUrl() provides a valid value).Defaults to: empty (no URI configured).
Returns
Authorization server URL that serves authorization requests.

 
Optional< URI > idpOauthDeviceCodeUrl ()
 Endpoint for Device Authorization Request in Device Authorization Grant flow (may be omitted if idpOidcDiscoveryUrl() provides a valid value).Only required when Device Authorization Grant flow is being used. Defaults to: empty (no URI configured).
Returns
Authorization server URL that serves device authorization requests.

 
Optional< URI > idpOauthTokenUrl ()
 Endpoint for Access Token Request or Device Access Token Request (may be omitted if idpOidcDiscoveryUrl() provides a valid value).Defaults to: empty (no URI configured).
Returns
Authorization server URL that serves access token requests.

 
Optional< String > idpOauthClientId ()
 Application credentials for OAuth/Open ID Connect.Defaults to: empty (no client id configured).
Returns
The value to use as OAuth client id.

 
Optional< String > idpOauthClientSecret ()
 Application credentials for OAuth/Open ID Connect.Required for some OAuth flows or for some Identity Providers. Defaults to: empty (no client secret configured).
Returns
The value to use as OAuth client secret.

 
Optional< String > idpOauthScope ()
 Scopes to include in the Access and ID tokens requested via Open ID Connect.Default value: "openid".
Returns
Array in String format: space separated scope names. Minimum viable setting is "openid", which is also the default value.

 
Optional< URI > idpUserinfoUrl ()
 Endpoint handling the UserInfo Request (may be omitted if idpOidcDiscoveryUrl() provides a valid value).Defaults to: empty (no URI configured).
Returns
OpenID Connect server URL that serves user info requests.

 
Optional< URI > idpJwksUri ()
 URL path to read public key used to verify JWTs received from Authorization Server authenticating Open ID Connect session.Defaults to: empty (no URI configured).
Returns
Authorization server URL that provides token signature verification keys in JSON Web Keys format.

 
Optional< URI > authRedirectUri ()
 Fully specified redirect URL to use for PKCE Flow Client.Note: the client application callback URL must be registered with the Authorization Server (Identity Provider). Defaults to: empty (no URI configured).
Returns
The URL to use as the OAuth client's redirect_uri.

 
Optional< String > authRedirectPath ()
 Path fragment for local redirect URL to use for PKCE Flow Client.This should be the path on http://localhost that the IDP will redirect to for successful authentication during the PKCE flow. Defaults to: /login/callback (interpreted as http://localhost/login/callback). Note: the client application callback URL must be registered with the Authorization Server (Identity Provider). This fragment is ignored if auth_redirect_uri is specified.
Returns
The URL path to use in the OAuth client's redirect_uri.

 
int authRedirectPort ()
 Local port number for PKCE Flow login callback redirect.Defaults to random port (denoted by port = 0).
Returns
The HTTP server port where theOAuth client listens at. Also used in the OAuth client's redirect_uri value.

 
Optional< String > authSuccessMessage ()
 Path to file / resource containing response for successful login (see PKCE Flow Client implementation).Default value: empty (no resource path for the success message is configured).
Returns
HTTP response body to use as response for successful login in PKCE Flow Client implementation.

 
float tokenRefreshLeewaySeconds ()
 The number of seconds before expiry time that an ID Token or JWT will be automatically refreshed.Default value: 30 seconds.
Returns
access token refresh leeway in seconds. Defaults to: DEFAULT_TOKEN_REFRESH_LEEWAY_SECONDS.

 
float httpTimeoutSeconds ()
 Timeout for HTTP requests.Defaults to DEFAULT_HTTP_TIMEOUT_SECONDS which equals 30.0 seconds. Timeout value must be greater than 0.
Returns
HTTP timeout in seconds. .

 
Optional< String > httpsProxy ()
 Proxy to use for HTTPS requests.The proxy URL must define a hostname and port. The format, including scheme is: proxy://hostname:port. E.g. proxy://localhost:32008. Defaults to empty (no proxy).
Returns
HTTP proxy address.

 
- Public Member Functions inherited from tenduke.sdk.core.model.config.AbstractConfigWithFallback< AuthConfig >
 AbstractConfigWithFallback (final C config, final C fallback)
 Initializes a new instance of this class with the given configuration and fallback instances.
 
AbstractConfigWithFallback withConfig (final C config)
 Sets the configuration instance to use as priority one.
 
AbstractConfigWithFallback withFallbackConfig (final C config)
 Sets the configuration instance to use as a fallback.
 
- Public Member Functions inherited from tenduke.sdk.core.model.config.AuthConfig
- Public Member Functions inherited from tenduke.sdk.core.model.config.HttpClientConfig
- Public Member Functions inherited from tenduke.sdk.core.model.config.Configuration

Additional Inherited Members

- Public Attributes inherited from tenduke.sdk.core.model.config.AuthConfig
float DEFAULT_TOKEN_REFRESH_LEEWAY_SECONDS = 30.0F
 Defines the default token expiration related refresh leeway in seconds.
 
- Public Attributes inherited from tenduke.sdk.core.model.config.HttpClientConfig
float DEFAULT_HTTP_TIMEOUT_SECONDS = 30.0F
 Defines the default HTTP connect, call, read and write timeout value in seconds.
 

Constructor & Destructor Documentation

◆ AuthConfigWithFallback()

tenduke.sdk.core.model.config.AuthConfigWithFallback.AuthConfigWithFallback ( final AuthConfig config,
final AuthConfig fallback )

Creates a new instance with the given primary and fallback configuration objects.

Parameters
configThe first level configuration instance.
fallbackThe fallback configuration to use if the first level configuration does not provide a value.

Member Function Documentation

◆ authRedirectPath()

Optional< String > tenduke.sdk.core.model.config.AuthConfigWithFallback.authRedirectPath ( )

Path fragment for local redirect URL to use for PKCE Flow Client.This should be the path on http://localhost that the IDP will redirect to for successful authentication during the PKCE flow. Defaults to: /login/callback (interpreted as http://localhost/login/callback). Note: the client application callback URL must be registered with the Authorization Server (Identity Provider). This fragment is ignored if auth_redirect_uri is specified.

Returns
The URL path to use in the OAuth client's redirect_uri.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ authRedirectPort()

int tenduke.sdk.core.model.config.AuthConfigWithFallback.authRedirectPort ( )

Local port number for PKCE Flow login callback redirect.Defaults to random port (denoted by port = 0).

Returns
The HTTP server port where theOAuth client listens at. Also used in the OAuth client's redirect_uri value.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ authRedirectUri()

Optional< URI > tenduke.sdk.core.model.config.AuthConfigWithFallback.authRedirectUri ( )

Fully specified redirect URL to use for PKCE Flow Client.Note: the client application callback URL must be registered with the Authorization Server (Identity Provider). Defaults to: empty (no URI configured).

Returns
The URL to use as the OAuth client's redirect_uri.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ authSuccessMessage()

Optional< String > tenduke.sdk.core.model.config.AuthConfigWithFallback.authSuccessMessage ( )

Path to file / resource containing response for successful login (see PKCE Flow Client implementation).Default value: empty (no resource path for the success message is configured).

Returns
HTTP response body to use as response for successful login in PKCE Flow Client implementation.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ httpsProxy()

Optional< String > tenduke.sdk.core.model.config.AuthConfigWithFallback.httpsProxy ( )

Proxy to use for HTTPS requests.The proxy URL must define a hostname and port. The format, including scheme is: proxy://hostname:port. E.g. proxy://localhost:32008. Defaults to empty (no proxy).

Returns
HTTP proxy address.

Implements tenduke.sdk.core.model.config.HttpClientConfig.

◆ httpTimeoutSeconds()

float tenduke.sdk.core.model.config.AuthConfigWithFallback.httpTimeoutSeconds ( )

Timeout for HTTP requests.Defaults to DEFAULT_HTTP_TIMEOUT_SECONDS which equals 30.0 seconds. Timeout value must be greater than 0.

Returns
HTTP timeout in seconds. .

Implements tenduke.sdk.core.model.config.HttpClientConfig.

◆ idpJwksUri()

Optional< URI > tenduke.sdk.core.model.config.AuthConfigWithFallback.idpJwksUri ( )

URL path to read public key used to verify JWTs received from Authorization Server authenticating Open ID Connect session.Defaults to: empty (no URI configured).

Returns
Authorization server URL that provides token signature verification keys in JSON Web Keys format.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ idpOauthAuthorizationUrl()

Optional< URI > tenduke.sdk.core.model.config.AuthConfigWithFallback.idpOauthAuthorizationUrl ( )

Endpoint for Authorization Request in Authorization Code or Implicit Grant flows (may be omitted if idpOidcDiscoveryUrl() provides a valid value).Defaults to: empty (no URI configured).

Returns
Authorization server URL that serves authorization requests.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ idpOauthClientId()

Optional< String > tenduke.sdk.core.model.config.AuthConfigWithFallback.idpOauthClientId ( )

Application credentials for OAuth/Open ID Connect.Defaults to: empty (no client id configured).

Returns
The value to use as OAuth client id.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ idpOauthClientSecret()

Optional< String > tenduke.sdk.core.model.config.AuthConfigWithFallback.idpOauthClientSecret ( )

Application credentials for OAuth/Open ID Connect.Required for some OAuth flows or for some Identity Providers. Defaults to: empty (no client secret configured).

Returns
The value to use as OAuth client secret.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ idpOauthDeviceCodeUrl()

Optional< URI > tenduke.sdk.core.model.config.AuthConfigWithFallback.idpOauthDeviceCodeUrl ( )

Endpoint for Device Authorization Request in Device Authorization Grant flow (may be omitted if idpOidcDiscoveryUrl() provides a valid value).Only required when Device Authorization Grant flow is being used. Defaults to: empty (no URI configured).

Returns
Authorization server URL that serves device authorization requests.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ idpOauthScope()

Optional< String > tenduke.sdk.core.model.config.AuthConfigWithFallback.idpOauthScope ( )

Scopes to include in the Access and ID tokens requested via Open ID Connect.Default value: "openid".

Returns
Array in String format: space separated scope names. Minimum viable setting is "openid", which is also the default value.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ idpOauthTokenUrl()

Optional< URI > tenduke.sdk.core.model.config.AuthConfigWithFallback.idpOauthTokenUrl ( )

Endpoint for Access Token Request or Device Access Token Request (may be omitted if idpOidcDiscoveryUrl() provides a valid value).Defaults to: empty (no URI configured).

Returns
Authorization server URL that serves access token requests.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ idpOidcDiscoveryUrl()

Optional< URI > tenduke.sdk.core.model.config.AuthConfigWithFallback.idpOidcDiscoveryUrl ( )

Used to retrieve the details of the Open ID Connect endpoints for the identity provider.Defaults to: empty (no URI configured).

Returns
The URL to use for loading OpenID Connect settings.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ idpUserinfoUrl()

Optional< URI > tenduke.sdk.core.model.config.AuthConfigWithFallback.idpUserinfoUrl ( )

Endpoint handling the UserInfo Request (may be omitted if idpOidcDiscoveryUrl() provides a valid value).Defaults to: empty (no URI configured).

Returns
OpenID Connect server URL that serves user info requests.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ publicKeyPath()

Optional< String > tenduke.sdk.core.model.config.AuthConfigWithFallback.publicKeyPath ( )

Directory path for storing public keys.Defaults to: "./local-config".

Returns
A file system path where public keys are stored.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ tokenPath()

Optional< String > tenduke.sdk.core.model.config.AuthConfigWithFallback.tokenPath ( )

Directory path for storing token data, e.g.JSON Web Tokens (JWT's). Defaults to: "./local-config".

Returns
A file system path where tokens are stored.

Implements tenduke.sdk.core.model.config.AuthConfig.

◆ tokenRefreshLeewaySeconds()

float tenduke.sdk.core.model.config.AuthConfigWithFallback.tokenRefreshLeewaySeconds ( )

The number of seconds before expiry time that an ID Token or JWT will be automatically refreshed.Default value: 30 seconds.

Returns
access token refresh leeway in seconds. Defaults to: DEFAULT_TOKEN_REFRESH_LEEWAY_SECONDS.

Implements tenduke.sdk.core.model.config.AuthConfig.


The documentation for this class was generated from the following file: