Package com.oracle.bmc.auth.internal
Class RefreshableSecurityTokenAdapter<T>
- java.lang.Object
-
- com.oracle.bmc.auth.internal.RefreshableSecurityTokenAdapter<T>
-
public class RefreshableSecurityTokenAdapter<T> extends Object
An extension of @SecurityTokenAdapterthat allows the security token to be refreshed
-
-
Constructor Summary
Constructors Constructor Description RefreshableSecurityTokenAdapter(String securityToken, SessionKeySupplier sessionKeySupplier, Function<T,String> resourcePrincipalSessionTokenSupplier, T resourcePrincipalCreationConfig)RefreshableSecurityTokenAdapter(Function<T,String> resourcePrincipalSessionTokenSupplier, T resourcePrincipalCreationConfig, SessionKeySupplier sessionKeySupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetSecurityToken()StringgetStringClaim(String key)Return a claim from the tokenDurationgetTokenValidDuration()Get half of the token durationbooleanisValid()Checks to see if the current token is still validvoidrefreshToken()
-
-
-
Constructor Detail
-
RefreshableSecurityTokenAdapter
public RefreshableSecurityTokenAdapter(Function<T,String> resourcePrincipalSessionTokenSupplier, T resourcePrincipalCreationConfig, SessionKeySupplier sessionKeySupplier)
-
-
Method Detail
-
isValid
public boolean isValid()
Checks to see if the current token is still valid- Returns:
- true if valid
-
getTokenValidDuration
public Duration getTokenValidDuration()
Get half of the token duration- Returns:
- half of the token duration
-
getSecurityToken
public String getSecurityToken()
-
refreshToken
public void refreshToken()
-
-