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.
Modifier and Type | Field and Description |
---|---|
protected List<ClientConfigurator> |
additionalClientConfigurator |
protected OciCircuitBreaker |
circuitBreaker |
protected ClientConfigurator |
clientConfigurator |
protected com.oracle.bmc.http.client.HttpClient |
federationClient |
protected com.oracle.bmc.http.client.HttpClient |
resourcePrincipalTokenClient |
protected SessionKeySupplier |
sessionKeySupplier |
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
String |
getSecurityToken()
Gets a security token from the federation endpoint.
|
protected SecurityTokenAdapter |
getSecurityTokenAdapter()
Get securityTokenAdapter
|
protected abstract SecurityTokenAdapter |
getSecurityTokenFromServer()
Gets a security token from the federation server
|
String |
getStringClaim(String key)
Get a claim embedded in the security token.
|
protected com.oracle.bmc.http.client.HttpClient |
makeClient(String endpoint,
RequestSigner requestSigner) |
protected ClientCall<?,com.oracle.bmc.auth.internal.GetResourcePrincipalTokenResponse.ResponseWrapper,?> |
prepareRptCall() |
String |
refreshAndGetSecurityToken()
Gets a security token from the federation endpoint.
|
String |
refreshAndGetSecurityTokenIfExpiringWithin(Duration time)
Gets a security token from the federation endpoint.
|
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.
|
protected String |
refreshAndGetSecurityTokenInner(boolean doFinalTokenValidityCheck,
Optional<Duration> time,
boolean refreshKeys) |
protected SecurityTokenAdapter |
requestSessionToken(GetResourcePrincipalSessionTokenRequest getResourcePrincipalSessionTokenRequest) |
protected final SessionKeySupplier sessionKeySupplier
protected final ClientConfigurator clientConfigurator
protected final List<ClientConfigurator> additionalClientConfigurator
protected final OciCircuitBreaker circuitBreaker
protected final com.oracle.bmc.http.client.HttpClient resourcePrincipalTokenClient
protected final com.oracle.bmc.http.client.HttpClient federationClient
public AbstractFederationClient(String resourcePrincipalTokenEndpoint, String federationEndpoint, SessionKeySupplier sessionKeySupplier, BasicAuthenticationDetailsProvider basicAuthenticationDetailsProvider, ClientConfigurator clientConfigurator, CircuitBreakerConfiguration circuitBreakerConfiguration)
Constructor of AbstractFederationClient.
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.public AbstractFederationClient(String resourcePrincipalTokenEndpoint, String federationEndpoint, SessionKeySupplier sessionKeySupplier, BasicAuthenticationDetailsProvider basicAuthenticationDetailsProvider, ClientConfigurator clientConfigurator, CircuitBreakerConfiguration circuitBreakerConfiguration, List<ClientConfigurator> additionalCLientConfigurators)
Constructor of AbstractFederationClient.
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.public AbstractFederationClient(String resourcePrincipalTokenUrl, String resourcePrincipalTokenEndpoint, String federationEndpoint, SessionKeySupplier sessionKeySupplier, BasicAuthenticationDetailsProvider basicAuthenticationDetailsProvider, ClientConfigurator clientConfigurator, CircuitBreakerConfiguration circuitBreakerConfiguration, List<ClientConfigurator> additionalCLientConfigurators)
Constructor of AbstractFederationClient.
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.protected com.oracle.bmc.http.client.HttpClient makeClient(String endpoint, RequestSigner requestSigner)
public String getSecurityToken()
Gets a security token from the federation endpoint. May use a cached token if it judged to still be valid.
getSecurityToken
in interface FederationClient
public 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.
refreshAndGetSecurityToken
in interface FederationClient
public 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.
refreshAndGetSecurityTokenIfExpiringWithin
in interface ProvidesConfigurableRefresh
time
- the duration to checkrefreshKeys
- boolean value to enable/disable refresh of keyspublic 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.
refreshAndGetSecurityTokenIfExpiringWithin
in interface ProvidesConfigurableRefresh
time
- the duration to checkprotected String refreshAndGetSecurityTokenInner(boolean doFinalTokenValidityCheck, Optional<Duration> time, boolean refreshKeys)
protected abstract SecurityTokenAdapter getSecurityTokenFromServer()
Gets a security token from the federation server
public 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.
getStringClaim
in interface FederationClient
protected SecurityTokenAdapter requestSessionToken(GetResourcePrincipalSessionTokenRequest getResourcePrincipalSessionTokenRequest)
protected ClientCall<?,com.oracle.bmc.auth.internal.GetResourcePrincipalTokenResponse.ResponseWrapper,?> prepareRptCall()
protected SecurityTokenAdapter getSecurityTokenAdapter()
Get securityTokenAdapter
Copyright © 2016–2024. All rights reserved.