public class FileBasedResourcePrincipalFederationClient extends Object implements FederationClient, ProvidesConfigurableRefresh
This class gets a security token from file.
Constructor and Description |
---|
FileBasedResourcePrincipalFederationClient(SessionKeySupplier sessionKeySupplier,
String resourcePrincipalSessionTokenPath)
Constructor of FileBasedResourcePrincipalFederationClient.
|
Modifier and Type | Method and Description |
---|---|
String |
getSecurityToken()
Gets a security token from the federation endpoint.
|
protected SecurityTokenAdapter |
getSecurityTokenFromFile()
Gets a security token from file
|
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.
|
public FileBasedResourcePrincipalFederationClient(SessionKeySupplier sessionKeySupplier, String resourcePrincipalSessionTokenPath)
Constructor of FileBasedResourcePrincipalFederationClient.
sessionKeySupplier
- the session key supplier.resourcePrincipalSessionTokenPath
- the path to load the RPST frompublic String getSecurityToken()
FederationClient
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 getStringClaim(String key)
FederationClient
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
public String refreshAndGetSecurityToken()
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.
refreshAndGetSecurityToken
in interface FederationClient
protected SecurityTokenAdapter getSecurityTokenFromFile()
Gets a security token from file
public String refreshAndGetSecurityTokenIfExpiringWithin(Duration time, boolean refreshKeys)
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.
refreshAndGetSecurityTokenIfExpiringWithin
in interface ProvidesConfigurableRefresh
time
- the duration to checkrefreshKeys
- boolean value to enable/disable refresh of keyspublic String refreshAndGetSecurityTokenIfExpiringWithin(Duration time)
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.
refreshAndGetSecurityTokenIfExpiringWithin
in interface ProvidesConfigurableRefresh
time
- the duration to checkCopyright © 2016–2024. All rights reserved.