Package com.oracle.bmc.auth.internal
Class AbstractFederationClient
- java.lang.Object
- 
- com.oracle.bmc.auth.internal.AbstractFederationClient
 
- 
- All Implemented Interfaces:
- FederationClient,- ProvidesConfigurableRefresh
 - Direct Known Subclasses:
- ResourcePrincipalsFederationClient,- ResourcePrincipalsV3FederationClient,- ResourcePrincipalV2FederationClient
 
 public abstract class AbstractFederationClient extends Object implements FederationClient, ProvidesConfigurableRefresh 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 SummaryFields Modifier and Type Field Description protected List<ClientConfigurator>additionalClientConfiguratorprotected OciCircuitBreakercircuitBreakerprotected ClientConfiguratorclientConfiguratorprotected com.oracle.bmc.http.client.HttpClientfederationClientprotected com.oracle.bmc.http.client.HttpClientresourcePrincipalTokenClientprotected SecurityTokenAdaptersecurityTokenAdapterprotected SessionKeySuppliersessionKeySupplier
 - 
Constructor SummaryConstructors Constructor Description AbstractFederationClient(String resourcePrincipalTokenEndpoint, String federationEndpoint, SessionKeySupplier sessionKeySupplier, BasicAuthenticationDetailsProvider basicAuthenticationDetailsProvider, ClientConfigurator clientConfigurator, CircuitBreakerConfiguration circuitBreakerConfiguration)Constructor of AbstractFederationClient.AbstractFederationClient(String resourcePrincipalTokenEndpoint, String federationEndpoint, SessionKeySupplier sessionKeySupplier, BasicAuthenticationDetailsProvider basicAuthenticationDetailsProvider, ClientConfigurator clientConfigurator, CircuitBreakerConfiguration circuitBreakerConfiguration, List<ClientConfigurator> additionalCLientConfigurators)Constructor of AbstractFederationClient.AbstractFederationClient(String resourcePrincipalTokenUrl, String resourcePrincipalTokenEndpoint, String federationEndpoint, SessionKeySupplier sessionKeySupplier, BasicAuthenticationDetailsProvider basicAuthenticationDetailsProvider, ClientConfigurator clientConfigurator, CircuitBreakerConfiguration circuitBreakerConfiguration, List<ClientConfigurator> additionalCLientConfigurators)Constructor of AbstractFederationClient.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringgetSecurityToken()Gets a security token from the federation endpoint.protected SecurityTokenAdaptergetSecurityTokenAdapter()Get securityTokenAdapterprotected abstract SecurityTokenAdaptergetSecurityTokenFromServer()Gets a security token from the federation serverStringgetStringClaim(String key)Get a claim embedded in the security token.protected com.oracle.bmc.http.client.HttpClientmakeClient(String endpoint, RequestSigner requestSigner)protected ClientCall<?,com.oracle.bmc.auth.internal.GetResourcePrincipalTokenResponse.ResponseWrapper,?>prepareRptCall()StringrefreshAndGetSecurityToken()Gets a security token from the federation endpoint.StringrefreshAndGetSecurityTokenIfExpiringWithin(Duration time)Gets a security token from the federation endpoint.StringrefreshAndGetSecurityTokenIfExpiringWithin(Duration time, boolean refreshKeys)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.protected StringrefreshAndGetSecurityTokenInner(boolean doFinalTokenValidityCheck, Optional<Duration> time, boolean refreshKeys)protected SecurityTokenAdapterrequestSessionToken(GetResourcePrincipalSessionTokenRequest getResourcePrincipalSessionTokenRequest)
 
- 
- 
- 
Field Detail- 
sessionKeySupplierprotected final SessionKeySupplier sessionKeySupplier 
 - 
securityTokenAdapterprotected volatile SecurityTokenAdapter securityTokenAdapter 
 - 
clientConfiguratorprotected final ClientConfigurator clientConfigurator 
 - 
additionalClientConfiguratorprotected final List<ClientConfigurator> additionalClientConfigurator 
 - 
circuitBreakerprotected final OciCircuitBreaker circuitBreaker 
 - 
resourcePrincipalTokenClientprotected final com.oracle.bmc.http.client.HttpClient resourcePrincipalTokenClient 
 - 
federationClientprotected final com.oracle.bmc.http.client.HttpClient federationClient 
 
- 
 - 
Constructor Detail- 
AbstractFederationClientpublic AbstractFederationClient(String resourcePrincipalTokenEndpoint, String federationEndpoint, SessionKeySupplier sessionKeySupplier, BasicAuthenticationDetailsProvider basicAuthenticationDetailsProvider, ClientConfigurator clientConfigurator, CircuitBreakerConfiguration circuitBreakerConfiguration) Constructor of AbstractFederationClient.- Parameters:
- resourcePrincipalTokenEndpoint- the endpoint that can provide the resource principal token.
- federationEndpoint- the endpoint that can provide the resource principal session token.
- sessionKeySupplier- the session key supplier.
- basicAuthenticationDetailsProvider- the instance principals authentication details provider.
- clientConfigurator- the reset client configurator.
 
 - 
AbstractFederationClientpublic AbstractFederationClient(String resourcePrincipalTokenEndpoint, String federationEndpoint, SessionKeySupplier sessionKeySupplier, BasicAuthenticationDetailsProvider basicAuthenticationDetailsProvider, ClientConfigurator clientConfigurator, CircuitBreakerConfiguration circuitBreakerConfiguration, List<ClientConfigurator> additionalCLientConfigurators) Constructor of AbstractFederationClient.- Parameters:
- resourcePrincipalTokenEndpoint- the endpoint that can provide the resource principal token.
- federationEndpoint- the endpoint that can provide the resource principal session token.
- sessionKeySupplier- the session key supplier.
- basicAuthenticationDetailsProvider- the instance principals authentication details provider.
- clientConfigurator- the reset client configurator.
 
 - 
AbstractFederationClientpublic AbstractFederationClient(String resourcePrincipalTokenUrl, String resourcePrincipalTokenEndpoint, String federationEndpoint, SessionKeySupplier sessionKeySupplier, BasicAuthenticationDetailsProvider basicAuthenticationDetailsProvider, ClientConfigurator clientConfigurator, CircuitBreakerConfiguration circuitBreakerConfiguration, List<ClientConfigurator> additionalCLientConfigurators) Constructor of AbstractFederationClient.- Parameters:
- resourcePrincipalTokenUrl- the complete url that can provide the resource principal token.
- resourcePrincipalTokenEndpoint- the endpoint that can provide the resource principal token.
- federationEndpoint- the endpoint that can provide the resource principal session token.
- sessionKeySupplier- the session key supplier.
- basicAuthenticationDetailsProvider- the instance principals authentication details provider.
- clientConfigurator- the reset client configurator.
 
 
- 
 - 
Method Detail- 
makeClientprotected com.oracle.bmc.http.client.HttpClient makeClient(String endpoint, RequestSigner requestSigner) 
 - 
getSecurityTokenpublic String getSecurityToken() Gets a security token from the federation endpoint.May use a cached token if it judged to still be valid. - Specified by:
- getSecurityTokenin interface- FederationClient
- Returns:
- A security token that can be used to authenticate requests.
 
 - 
refreshAndGetSecurityTokenpublic String 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. - Specified by:
- refreshAndGetSecurityTokenin interface- FederationClient
- Returns:
- A security token that can be used to authenticate requests.
 
 - 
refreshAndGetSecurityTokenIfExpiringWithinpublic String refreshAndGetSecurityTokenIfExpiringWithin(Duration time, boolean refreshKeys) 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. - Specified by:
- refreshAndGetSecurityTokenIfExpiringWithinin interface- ProvidesConfigurableRefresh
- Parameters:
- time- the duration to check
- refreshKeys- boolean value to enable/disable refresh of keys
- Returns:
- A security token that can be used to authenticate requests.
 
 - 
refreshAndGetSecurityTokenIfExpiringWithinpublic String refreshAndGetSecurityTokenIfExpiringWithin(Duration time) 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. - Specified by:
- refreshAndGetSecurityTokenIfExpiringWithinin interface- ProvidesConfigurableRefresh
- Parameters:
- time- the duration to check
- Returns:
- A security token that can be used to authenticate requests.
 
 - 
refreshAndGetSecurityTokenInnerprotected String refreshAndGetSecurityTokenInner(boolean doFinalTokenValidityCheck, Optional<Duration> time, boolean refreshKeys) 
 - 
getSecurityTokenFromServerprotected abstract SecurityTokenAdapter getSecurityTokenFromServer() Gets a security token from the federation server- Returns:
- the security token, which is basically a JWT token string
 
 - 
getStringClaimpublic String getStringClaim(String key) Get a claim embedded in the security token.May use the cached token if it is judged to still be valid. - Specified by:
- getStringClaimin interface- FederationClient
 
 - 
requestSessionTokenprotected SecurityTokenAdapter requestSessionToken(GetResourcePrincipalSessionTokenRequest getResourcePrincipalSessionTokenRequest) 
 - 
prepareRptCallprotected ClientCall<?,com.oracle.bmc.auth.internal.GetResourcePrincipalTokenResponse.ResponseWrapper,?> prepareRptCall() 
 - 
getSecurityTokenAdapterprotected SecurityTokenAdapter getSecurityTokenAdapter() Get securityTokenAdapter- Returns:
- securityTokenAdapter
 
 
- 
 
-