Package com.oracle.bmc.auth.internal
Class FixedContentResourcePrincipalFederationClient
- java.lang.Object
-
- com.oracle.bmc.auth.internal.FixedContentResourcePrincipalFederationClient
-
- All Implemented Interfaces:
FederationClient
,ProvidesConfigurableRefresh
public class FixedContentResourcePrincipalFederationClient extends Object implements FederationClient, ProvidesConfigurableRefresh
This class returns a security token, supplied as a fixed value.
-
-
Constructor Summary
Constructors Constructor Description FixedContentResourcePrincipalFederationClient(String resourcePrincipalSessionToken, SessionKeySupplier sessionKeySupplier)
Constructor of FixedContentResourcePrincipalFederationClient.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getSecurityToken()
Gets a security token from the federation endpoint.String
getStringClaim(String key)
Get a claim embedded in the security token.String
refreshAndGetSecurityToken()
Gets a security token from the federation endpoint.String
refreshAndGetSecurityTokenIfExpiringWithin(Duration time)
Gets a security token from the federation endpoint if the security token expires within the provided duration.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.
-
-
-
Constructor Detail
-
FixedContentResourcePrincipalFederationClient
public FixedContentResourcePrincipalFederationClient(String resourcePrincipalSessionToken, SessionKeySupplier sessionKeySupplier)
Constructor of FixedContentResourcePrincipalFederationClient.- Parameters:
resourcePrincipalSessionToken
- the constant value for the RPSTsessionKeySupplier
- the associated SessionKeySupplier
-
-
Method Detail
-
getSecurityToken
public String getSecurityToken()
Description copied from interface:FederationClient
Gets a security token from the federation endpoint.May use a cached token if it judged to still be valid.
- Specified by:
getSecurityToken
in interfaceFederationClient
- Returns:
- A security token that can be used to authenticate requests.
-
refreshAndGetSecurityToken
public String refreshAndGetSecurityToken()
Description copied from interface:FederationClient
Gets 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:
refreshAndGetSecurityToken
in interfaceFederationClient
- Returns:
- A security token that can be used to authenticate requests.
-
getStringClaim
public String getStringClaim(String key)
Description copied from interface:FederationClient
Get a claim embedded in the security token.May use the cached token if it is judged to still be valid.
- Specified by:
getStringClaim
in interfaceFederationClient
-
refreshAndGetSecurityTokenIfExpiringWithin
public String refreshAndGetSecurityTokenIfExpiringWithin(Duration time, boolean refreshKeys)
Description copied from interface:ProvidesConfigurableRefresh
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:
refreshAndGetSecurityTokenIfExpiringWithin
in interfaceProvidesConfigurableRefresh
- Parameters:
time
- the duration to checkrefreshKeys
- boolean value to enable/disable refresh of keys- Returns:
- A security token that can be used to authenticate requests.
-
refreshAndGetSecurityTokenIfExpiringWithin
public String refreshAndGetSecurityTokenIfExpiringWithin(Duration time)
Description copied from interface:ProvidesConfigurableRefresh
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:
refreshAndGetSecurityTokenIfExpiringWithin
in interfaceProvidesConfigurableRefresh
- Parameters:
time
- the duration to check- Returns:
- A security token that can be used to authenticate requests.
-
-