Package com.oracle.bmc.auth.internal
Class ResourcePrincipalsV3FederationClient
- java.lang.Object
- 
- com.oracle.bmc.auth.internal.AbstractFederationClient
- 
- com.oracle.bmc.auth.internal.ResourcePrincipalsV3FederationClient
 
 
- 
- All Implemented Interfaces:
- FederationClient,- ProvidesConfigurableRefresh
 
 public class ResourcePrincipalsV3FederationClient extends AbstractFederationClient This class gets a security token from the auth service by fetching the RPST1 and then passing along the RPST1 to get RPT2 and further get security token RPST2 from the auth service, this nested fetching of security token continues for 10 levels or when the opc-parent-url header in the rpt response is the same as the rpt endpoint
- 
- 
Field Summary- 
Fields inherited from class com.oracle.bmc.auth.internal.AbstractFederationClientadditionalClientConfigurator, circuitBreaker, federationClient, resourcePrincipalTokenClient, securityTokenAdapter, sessionKeySupplier
 
- 
 - 
Constructor SummaryConstructors Constructor Description ResourcePrincipalsV3FederationClient(String resourcePrincipalTokenUrl, String resourcePrincipalSessionTokenEndpoint, SessionKeySupplier sessionKeySupplier, ResourcePrincipalAuthenticationDetailsProvider leafAuthDetailsProvider, ClientConfigurator clientConfigurator, CircuitBreakerConfiguration circuitBreakerConfiguration)Constructor of ResourcePrincipalsFederationClient.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetSecurityToken()Gets a security token from the federation endpoint.protected SecurityTokenAdaptergetSecurityTokenFromServer()Gets a security token from the federation serverprotected SecurityTokenAdaptergetSecurityTokenFromServerInner(RSAPublicKey publicKey, int depth, String lastResourcePrincipalTokenUrl, com.oracle.bmc.http.client.HttpClient resourcePrincipalTokenClient, com.oracle.bmc.http.client.HttpClient federationClient)protected ClientCall<?,com.oracle.bmc.auth.internal.GetResourcePrincipalTokenResponse.ResponseWrapper,?>prepareRptCall(com.oracle.bmc.http.client.HttpClient resourcePrincipalTokenClient)StringrefreshAndGetSecurityTokenIfExpiringWithin(Duration time)Gets a security token from the federation endpoint if the security token expires within the provided duration.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 SecurityTokenAdapterrequestSessionToken(com.oracle.bmc.http.client.HttpClient federationClient, GetResourcePrincipalSessionTokenRequest getResourcePrincipalSessionTokenRequest)- 
Methods inherited from class com.oracle.bmc.auth.internal.AbstractFederationClientgetSecurityTokenAdapter, getStringClaim, makeClient, prepareRptCall, refreshAndGetSecurityToken, refreshAndGetSecurityTokenInner, requestSessionToken
 
- 
 
- 
- 
- 
Constructor Detail- 
ResourcePrincipalsV3FederationClientpublic ResourcePrincipalsV3FederationClient(String resourcePrincipalTokenUrl, String resourcePrincipalSessionTokenEndpoint, SessionKeySupplier sessionKeySupplier, ResourcePrincipalAuthenticationDetailsProvider leafAuthDetailsProvider, ClientConfigurator clientConfigurator, CircuitBreakerConfiguration circuitBreakerConfiguration) Constructor of ResourcePrincipalsFederationClient.- Parameters:
- resourcePrincipalTokenUrl- the direct url that can provide the resource principal token.
- resourcePrincipalSessionTokenEndpoint- the endpoint that can provide the resource principal session token.
- sessionKeySupplier- the session key supplier.
- leafAuthDetailsProvider- the auth provider for leaf resource
- clientConfigurator- the rest client configurator.
- circuitBreakerConfiguration- the rest client circuit breaker configuration.
 
 
- 
 - 
Method Detail- 
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
- Overrides:
- getSecurityTokenin class- AbstractFederationClient
- 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
- Overrides:
- refreshAndGetSecurityTokenIfExpiringWithinin class- AbstractFederationClient
- 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 if the security token expires within the provided duration.This will always retrieve a new token from the federation endpoint and does not use a cached token. - Specified by:
- refreshAndGetSecurityTokenIfExpiringWithinin interface- ProvidesConfigurableRefresh
- Overrides:
- refreshAndGetSecurityTokenIfExpiringWithinin class- AbstractFederationClient
- Parameters:
- time- the duration to check
- Returns:
- A security token that can be used to authenticate requests.
 
 - 
getSecurityTokenFromServerprotected SecurityTokenAdapter getSecurityTokenFromServer() Gets a security token from the federation server- Specified by:
- getSecurityTokenFromServerin class- AbstractFederationClient
- Returns:
- the security token, which is basically a JWT token string
 
 - 
getSecurityTokenFromServerInnerprotected SecurityTokenAdapter getSecurityTokenFromServerInner(RSAPublicKey publicKey, int depth, String lastResourcePrincipalTokenUrl, com.oracle.bmc.http.client.HttpClient resourcePrincipalTokenClient, com.oracle.bmc.http.client.HttpClient federationClient) 
 - 
prepareRptCallprotected ClientCall<?,com.oracle.bmc.auth.internal.GetResourcePrincipalTokenResponse.ResponseWrapper,?> prepareRptCall(com.oracle.bmc.http.client.HttpClient resourcePrincipalTokenClient) 
 - 
requestSessionTokenprotected SecurityTokenAdapter requestSessionToken(com.oracle.bmc.http.client.HttpClient federationClient, GetResourcePrincipalSessionTokenRequest getResourcePrincipalSessionTokenRequest) 
 
- 
 
-