Package oracle.stellent.ridc.auth.impl
Class BearerTokenCredentials
java.lang.Object
oracle.stellent.ridc.auth.impl.BearerTokenCredentials
- All Implemented Interfaces:
Credentials,Credentials.BearerTokenCredentials
@Exported
public class BearerTokenCredentials
extends Object
implements Credentials.BearerTokenCredentials
Credentials to use for Bearer Token Auth requests.
Note - this credential should be not be shared across threads in the event
setter methods will be triggered post construction. In its current format,
it is not thread-safe for post construction updates.
-
Nested Class Summary
Nested classes/interfaces inherited from interface oracle.stellent.ridc.auth.Credentials
Credentials.AppIdClientCredentials, Credentials.BasicCredentials, Credentials.BearerTokenCredentials, Credentials.HeaderCredentials, Credentials.HttpClientCredentials, Credentials.UserNameOnlyCredentials -
Constructor Summary
ConstructorsConstructorDescriptionBearerTokenCredentials(char[] token) Constructor wrapping a bearer token applicable for all realms with no expiry timeBearerTokenCredentials(char[] token, String realm, long expiryTime) Constructor wrapping a bearer token applicable for the specified realm and value until the specified expiryTimeBearerTokenCredentials(String token) Constructor wrapping a bearer token applicable for all realms with no expiry time -
Method Summary
Modifier and TypeMethodDescriptionlonggetLogId()getRealm()char[]getToken()static StringmaskToken(char[] token) voidsetExpiryTime(long expiryTime) set the expiry time of the token An expiryTime value less than or equal to 0 indicates the token never expires.voidset the realm name to which the token applies (null indicates all realms)voidsetToken(char[] token) set the bearer tokenvoiderase the bearer token
-
Constructor Details
-
BearerTokenCredentials
Constructor wrapping a bearer token applicable for all realms with no expiry time- Parameters:
token- the bearer token
-
BearerTokenCredentials
public BearerTokenCredentials(char[] token) Constructor wrapping a bearer token applicable for all realms with no expiry time- Parameters:
token- the bearer token
-
BearerTokenCredentials
Constructor wrapping a bearer token applicable for the specified realm and value until the specified expiryTime- Parameters:
token- the bearer tokenrealm- the realm to which the token applies (null indicates all realms)expiryTime- the number of milliseconds post epoch at which point the token expires. An expiryTime value less than or equal to 0 indicates the token never expires.
-
-
Method Details
-
getToken
public char[] getToken()- Specified by:
getTokenin interfaceCredentials.BearerTokenCredentials- Returns:
- the bearer token
-
setToken
public void setToken(char[] token) set the bearer token- Parameters:
token- the bearer token
-
getRealm
- Specified by:
getRealmin interfaceCredentials.BearerTokenCredentials- Returns:
- the realm name to which the token applies (null indicates all realms)
-
setRealm
set the realm name to which the token applies (null indicates all realms)- Parameters:
realm- the token's associated realm
-
getExpiryTime
public long getExpiryTime()- Specified by:
getExpiryTimein interfaceCredentials.BearerTokenCredentials- Returns:
- the number of milliseconds post epoch at which point the token expires. An expiryTime value less than or equal to 0 indicates the token never expires.
-
setExpiryTime
public void setExpiryTime(long expiryTime) set the expiry time of the token An expiryTime value less than or equal to 0 indicates the token never expires.- Parameters:
expiryTime- the number of milliseconds post epoch at which point the token expires.
-
wipeToken
public void wipeToken()erase the bearer token -
getUserName
- Specified by:
getUserNamein interfaceCredentials- Returns:
- the user name associated with the credential
-
getCredentialsClassName
- Specified by:
getCredentialsClassNamein interfaceCredentials- Returns:
- the name of the credentials class
-
getLogId
- Specified by:
getLogIdin interfaceCredentials- Returns:
- the identifier used for these credentials, used for logging messages
-
maskToken
-