Package com.oracle.bmc.auth.internal
Class FileBasedResourcePrincipalFederationClient
- java.lang.Object
- 
- com.oracle.bmc.auth.internal.FileBasedResourcePrincipalFederationClient
 
- 
- All Implemented Interfaces:
- FederationClient,- ProvidesConfigurableRefresh
 
 public class FileBasedResourcePrincipalFederationClient extends Object implements FederationClient, ProvidesConfigurableRefresh This class gets a security token from file.
- 
- 
Constructor SummaryConstructors Constructor Description FileBasedResourcePrincipalFederationClient(SessionKeySupplier sessionKeySupplier, String resourcePrincipalSessionTokenPath)Constructor of FileBasedResourcePrincipalFederationClient.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetSecurityToken()Gets a security token from the federation endpoint.protected SecurityTokenAdaptergetSecurityTokenFromFile()Gets a security token from fileStringgetStringClaim(String key)Get a claim embedded in the security token.StringrefreshAndGetSecurityToken()Gets a security token from the federation endpoint.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.
 
- 
- 
- 
Constructor Detail- 
FileBasedResourcePrincipalFederationClientpublic FileBasedResourcePrincipalFederationClient(SessionKeySupplier sessionKeySupplier, String resourcePrincipalSessionTokenPath) Constructor of FileBasedResourcePrincipalFederationClient.- Parameters:
- sessionKeySupplier- the session key supplier.
- resourcePrincipalSessionTokenPath- the path to load the RPST from
 
 
- 
 - 
Method Detail- 
getSecurityTokenpublic String getSecurityToken() Description copied from interface:FederationClientGets 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.
 
 - 
getStringClaimpublic String getStringClaim(String key) Description copied from interface:FederationClientGet 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
 
 - 
refreshAndGetSecurityTokenpublic String refreshAndGetSecurityToken() Description copied from interface:FederationClientGets a security token from the federation endpoint.This will always retreive 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.
 
 - 
getSecurityTokenFromFileprotected SecurityTokenAdapter getSecurityTokenFromFile() Gets a security token from file- Returns:
- the security token, which is basically a JWT token string
 
 - 
refreshAndGetSecurityTokenIfExpiringWithinpublic String refreshAndGetSecurityTokenIfExpiringWithin(Duration time, boolean refreshKeys) Description copied from interface:ProvidesConfigurableRefreshGets 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) Description copied from interface:ProvidesConfigurableRefreshGets 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
- Parameters:
- time- the duration to check
- Returns:
- A security token that can be used to authenticate requests.
 
 
- 
 
-