Class AccessToken
java.lang.Object
com.codename1.backend.security.oauth2.client.credentials.AccessToken
An access token this server obtained to call another one.
The value is a credential: toString() never prints it, so a token that
ends up in a log line or an exception message names its type, scopes and
expiry and nothing anyone could replay.
-
Constructor Summary
ConstructorsConstructorDescriptionAccessToken(String tokenValue, String tokenType, long expiresAtMillis, Set<String> scopes) -
Method Summary
-
Constructor Details
-
AccessToken
- Parameters:
tokenValue- the token, as the endpoint issued ittokenType- the type the endpoint named, normallyBearerexpiresAtMillis- when it stops being accepted, in epoch millisecondsscopes- what it was issued for; empty when the endpoint did not say
-
-
Method Details
-
getTokenValue
-
getTokenType
-
getExpiresAtMillis
public long getExpiresAtMillis() -
getScopes
-
isExpired
public boolean isExpired(long nowMillis) True oncenowMillishas reached the expiry. -
toAuthorizationHeader
The value of anAuthorizationheader that presents this token. -
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-