Top Description Fields Constructors Methods
com.oracle.bmc.auth.internal

public abstract Class AbstractFederationClient

extends Object
implements FederationClient, ProvidesConfigurableRefresh
Class Inheritance
All Implemented Interfaces
com.oracle.bmc.auth.ProvidesConfigurableRefresh, com.oracle.bmc.auth.internal.FederationClient
Known Direct Subclasses
com.oracle.bmc.auth.internal.ResourcePrincipalsFederationClient, com.oracle.bmc.auth.internal.ResourcePrincipalsV3FederationClient, com.oracle.bmc.auth.internal.ResourcePrincipalV2FederationClient
Imports
com.oracle.bmc.auth.BasicAuthenticationDetailsProvider, .ProvidesConfigurableRefresh, .ProvidesCustomRequestSigner, .SessionKeySupplier, com.oracle.bmc.circuitbreaker.CircuitBreakerConfiguration, .OciCircuitBreaker, com.oracle.bmc.http.ClientConfigurator, .Priorities, com.oracle.bmc.http.client.HttpClient, .HttpClientBuilder, .HttpProvider, .Method, .StandardClientProperties, com.oracle.bmc.http.internal.AuthnClientFilter, .CircuitBreakerHelper, .ClientCall, .ClientIdFilter, .LogHeadersFilter, com.oracle.bmc.http.signing.DefaultRequestSigner, .RequestSigner, com.oracle.bmc.requests.BmcRequest, com.oracle.bmc.retrier.RetryConfiguration, com.oracle.bmc.util.internal.StringUtils, .Validate, com.oracle.bmc.waiter.MaxAttemptsTerminationStrategy, .FixedTimeDelayStrategy, org.slf4j.Logger, java.net.URI, java.time.Duration, java.util.ArrayList, .Collections, .List, .Objects, .Optional

This class gets a security token from the auth service by signing the request with a PKI issued leaf certificate, passing along a temporary public key that is bounded to the the security token, and the leaf certificate.

Field Summary

Modifier and TypeField and Description
protected final List<ClientConfigurator>
protected final OciCircuitBreaker
protected final ClientConfigurator
protected final HttpClient
private static final Logger
protected final HttpClient
private volatile SecurityTokenAdapter
protected final SessionKeySupplier

Constructor Summary

AccessConstructor and Description
public
AbstractFederationClient(String
the endpoint that can provide the resource principal token.
resourcePrincipalTokenEndpoint
,
String
the endpoint that can provide the resource principal session token.
federationEndpoint
,
SessionKeySupplier
the session key supplier.
sessionKeySupplier
,
BasicAuthenticationDetailsProvider
the instance principals authentication details provider.
basicAuthenticationDetailsProvider
,
ClientConfigurator
the reset client configurator.
clientConfigurator
,
CircuitBreakerConfiguration circuitBreakerConfiguration)

Constructor of AbstractFederationClient.

public
AbstractFederationClient(String
the endpoint that can provide the resource principal token.
resourcePrincipalTokenEndpoint
,
String
the endpoint that can provide the resource principal session token.
federationEndpoint
,
SessionKeySupplier
the session key supplier.
sessionKeySupplier
,
BasicAuthenticationDetailsProvider
the instance principals authentication details provider.
basicAuthenticationDetailsProvider
,
ClientConfigurator
the reset client configurator.
clientConfigurator
,
CircuitBreakerConfiguration circuitBreakerConfiguration, List<ClientConfigurator> additionalCLientConfigurators)

Constructor of AbstractFederationClient.

public
AbstractFederationClient(String
the complete url that can provide the resource principal token.
resourcePrincipalTokenUrl
,
String
the endpoint that can provide the resource principal token.
resourcePrincipalTokenEndpoint
,
String
the endpoint that can provide the resource principal session token.
federationEndpoint
,
SessionKeySupplier
the session key supplier.
sessionKeySupplier
,
BasicAuthenticationDetailsProvider
the instance principals authentication details provider.
basicAuthenticationDetailsProvider
,
ClientConfigurator
the reset client configurator.
clientConfigurator
,
CircuitBreakerConfiguration circuitBreakerConfiguration, List<ClientConfigurator> additionalCLientConfigurators)

Constructor of AbstractFederationClient.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

A security token that can be used to authenticate requests.
getSecurityToken
()

Implements com.oracle.bmc.auth.internal.FederationClient.getSecurityToken.

Gets a security token from the federation endpoint.

protected SecurityTokenAdapter

Returns:

securityTokenAdapter
getSecurityTokenAdapter
()

Get securityTokenAdapter

protected abstract SecurityTokenAdapter

Returns:

the security token, which is basically a JWT token string
getSecurityTokenFromServer
()

Gets a security token from the federation server

public String
getStringClaim(String key)

Implements com.oracle.bmc.auth.internal.FederationClient.getStringClaim.

Get a claim embedded in the security token.

protected HttpClient
makeClient(String endpoint, RequestSigner requestSigner)

protected ClientCall<?, GetResourcePrincipalTokenResponse.ResponseWrapper, ?>
public String

Returns:

A security token that can be used to authenticate requests.
refreshAndGetSecurityToken
()

Implements com.oracle.bmc.auth.internal.FederationClient.refreshAndGetSecurityToken.

Gets a security token from the federation endpoint.

public String

Returns:

A security token that can be used to authenticate requests.
refreshAndGetSecurityTokenIfExpiringWithin
(Duration
the duration to check
time
,
boolean
boolean value to enable/disable refresh of keys
refreshKeys
)

Implements com.oracle.bmc.auth.ProvidesConfigurableRefresh.refreshAndGetSecurityTokenIfExpiringWithin.

Gets a security token from the federation endpoint if the security token expires within the provided duration and allows to enable/disable refresh of keys.

public String

Returns:

A security token that can be used to authenticate requests.
refreshAndGetSecurityTokenIfExpiringWithin
(Duration
the duration to check
time
)

Implements com.oracle.bmc.auth.ProvidesConfigurableRefresh.refreshAndGetSecurityTokenIfExpiringWithin.

Gets a security token from the federation endpoint.

protected String
refreshAndGetSecurityTokenInner(final boolean doFinalTokenValidityCheck, Optional<Duration> time, boolean refreshKeys)

protected SecurityTokenAdapter
requestSessionToken(GetResourcePrincipalSessionTokenRequest getResourcePrincipalSessionTokenRequest)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

additionalClientConfiguratorback to summary
protected final List<ClientConfigurator> additionalClientConfigurator
circuitBreakerback to summary
protected final OciCircuitBreaker circuitBreaker
clientConfiguratorback to summary
protected final ClientConfigurator clientConfigurator
federationClientback to summary
protected final HttpClient federationClient
LOGback to summary
private static final Logger LOG
resourcePrincipalTokenClientback to summary
protected final HttpClient resourcePrincipalTokenClient
securityTokenAdapterback to summary
private volatile SecurityTokenAdapter securityTokenAdapter
sessionKeySupplierback to summary
protected final SessionKeySupplier sessionKeySupplier

Constructor Detail

AbstractFederationClientback to summary
public AbstractFederationClient(String resourcePrincipalTokenEndpoint, String federationEndpoint, SessionKeySupplier sessionKeySupplier, BasicAuthenticationDetailsProvider basicAuthenticationDetailsProvider, ClientConfigurator clientConfigurator, CircuitBreakerConfiguration circuitBreakerConfiguration)

Constructor of AbstractFederationClient.

Parameters
resourcePrincipalTokenEndpoint:String

the endpoint that can provide the resource principal token.

federationEndpoint:String

the endpoint that can provide the resource principal session token.

sessionKeySupplier:SessionKeySupplier

the session key supplier.

basicAuthenticationDetailsProvider:BasicAuthenticationDetailsProvider

the instance principals authentication details provider.

clientConfigurator:ClientConfigurator

the reset client configurator.

AbstractFederationClientback to summary
public AbstractFederationClient(String resourcePrincipalTokenEndpoint, String federationEndpoint, SessionKeySupplier sessionKeySupplier, BasicAuthenticationDetailsProvider basicAuthenticationDetailsProvider, ClientConfigurator clientConfigurator, CircuitBreakerConfiguration circuitBreakerConfiguration, List<ClientConfigurator> additionalCLientConfigurators)

Constructor of AbstractFederationClient.

Parameters
resourcePrincipalTokenEndpoint:String

the endpoint that can provide the resource principal token.

federationEndpoint:String

the endpoint that can provide the resource principal session token.

sessionKeySupplier:SessionKeySupplier

the session key supplier.

basicAuthenticationDetailsProvider:BasicAuthenticationDetailsProvider

the instance principals authentication details provider.

clientConfigurator:ClientConfigurator

the reset client configurator.

AbstractFederationClientback to summary
public AbstractFederationClient(String resourcePrincipalTokenUrl, String resourcePrincipalTokenEndpoint, String federationEndpoint, SessionKeySupplier sessionKeySupplier, BasicAuthenticationDetailsProvider basicAuthenticationDetailsProvider, ClientConfigurator clientConfigurator, CircuitBreakerConfiguration circuitBreakerConfiguration, List<ClientConfigurator> additionalCLientConfigurators)

Constructor of AbstractFederationClient.

Parameters
resourcePrincipalTokenUrl:String

the complete url that can provide the resource principal token.

resourcePrincipalTokenEndpoint:String

the endpoint that can provide the resource principal token.

federationEndpoint:String

the endpoint that can provide the resource principal session token.

sessionKeySupplier:SessionKeySupplier

the session key supplier.

basicAuthenticationDetailsProvider:BasicAuthenticationDetailsProvider

the instance principals authentication details provider.

clientConfigurator:ClientConfigurator

the reset client configurator.

Method Detail

getSecurityTokenback to summary
public String getSecurityToken()

Implements com.oracle.bmc.auth.internal.FederationClient.getSecurityToken.

Gets a security token from the federation endpoint. May use a cached token if it judged to still be valid.

Returns:String

A security token that can be used to authenticate requests.

Annotations
@Override
getSecurityTokenAdapterback to summary
protected SecurityTokenAdapter getSecurityTokenAdapter()

Get securityTokenAdapter

Returns:SecurityTokenAdapter

securityTokenAdapter

getSecurityTokenFromServerback to summary
protected abstract SecurityTokenAdapter getSecurityTokenFromServer()

Gets a security token from the federation server

Returns:SecurityTokenAdapter

the security token, which is basically a JWT token string

getStringClaimback to summary
public String getStringClaim(String key)

Implements com.oracle.bmc.auth.internal.FederationClient.getStringClaim.

Get a claim embedded in the security token. May use the cached token if it is judged to still be valid.

makeClientback to summary
protected HttpClient makeClient(String endpoint, RequestSigner requestSigner)
prepareRptCallback to summary
protected ClientCall<?, GetResourcePrincipalTokenResponse.ResponseWrapper, ?> prepareRptCall()
refreshAndGetSecurityTokenback to summary
public String refreshAndGetSecurityToken()

Implements com.oracle.bmc.auth.internal.FederationClient.refreshAndGetSecurityToken.

Gets a security token from the federation endpoint. This will always retrieve a new token from the federation endpoint and does not use a cached token.

Returns:String

A security token that can be used to authenticate requests.

Annotations
@Override
refreshAndGetSecurityTokenIfExpiringWithinback to summary
public String refreshAndGetSecurityTokenIfExpiringWithin(Duration time, boolean refreshKeys)

Implements com.oracle.bmc.auth.ProvidesConfigurableRefresh.refreshAndGetSecurityTokenIfExpiringWithin.

Gets a security token from the federation endpoint if the security token expires within the provided duration and allows to enable/disable refresh of keys. This will always retrieve a new token from the federation endpoint and does not use a cached token.

Parameters
time:Duration

the duration to check

refreshKeys:boolean

boolean value to enable/disable refresh of keys

Returns:String

A security token that can be used to authenticate requests.

Annotations
@Override
refreshAndGetSecurityTokenIfExpiringWithinback to summary
public String refreshAndGetSecurityTokenIfExpiringWithin(Duration time)

Implements com.oracle.bmc.auth.ProvidesConfigurableRefresh.refreshAndGetSecurityTokenIfExpiringWithin.

Gets a security token from the federation endpoint. This will always retrieve a new token from the federation endpoint and does not use a cached token.

Parameters
time:Duration

the duration to check

Returns:String

A security token that can be used to authenticate requests.

Annotations
@Override
refreshAndGetSecurityTokenInnerback to summary
protected String refreshAndGetSecurityTokenInner(final boolean doFinalTokenValidityCheck, Optional<Duration> time, boolean refreshKeys)
requestSessionTokenback to summary
protected SecurityTokenAdapter requestSessionToken(GetResourcePrincipalSessionTokenRequest getResourcePrincipalSessionTokenRequest)