|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.directory.sdk.broker.types.Token
com.unboundid.directory.sdk.broker.types.AccessToken
@NotExtensible @Mutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class AccessToken
This class provides a data structure for working with OAuth2 access tokens.
Constructor Summary | |
---|---|
AccessToken(java.lang.String username,
java.util.Set<java.lang.String> authorities,
java.lang.String applicationId,
java.util.Date generateTimestamp,
long maxValiditySeconds,
java.util.Set<java.lang.String> scopeIds)
Construct a new access token instance. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Indicates whether the provided object is equal to this access token. |
java.util.Set<java.lang.String> |
getAuthorities()
Retrieves the authorities of the resource owner. |
RefreshToken |
getRefreshToken()
Retrieves the refresh token associated with this access token. |
java.util.Set<java.lang.String> |
getScopeIds()
Retrieves the set of scope IDs for which the client has been authorized. |
java.lang.String |
getUsername()
Retrieves the username of the resource owner this access token is associated with. |
int |
hashCode()
Retrieves a hash code for this access token. |
void |
setRefreshToken(RefreshToken refreshToken)
Sets the refresh token associated with this access token. |
protected void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this access token to the provided buffer. |
Methods inherited from class com.unboundid.directory.sdk.broker.types.Token |
---|
getApplicationId, getGenerateTimestamp, getMaxValiditySeconds, getValue, isExpired, setValue, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AccessToken(java.lang.String username, java.util.Set<java.lang.String> authorities, java.lang.String applicationId, java.util.Date generateTimestamp, long maxValiditySeconds, java.util.Set<java.lang.String> scopeIds)
username
- The username of the resource owner this access token is
associated with or null
if resource owner
authentication was not performed.authorities
- The authorities of the resource owner or empty if
resource owner authentication was not performed.
Must not be null.applicationId
- The application ID with which this token is
associated. Must not be null.generateTimestamp
- The time that this token was generated. Must not
be null.maxValiditySeconds
- The maximum length of time in seconds that this
token will be considered valid. Must not be null
and must not be negative.scopeIds
- The set of scopes for which the client has been authorized.
Must not be null.Method Detail |
---|
public java.lang.String getUsername()
null
.
null
if resource owner authentication was not
performed.public java.util.Set<java.lang.String> getAuthorities()
public java.util.Set<java.lang.String> getScopeIds()
public RefreshToken getRefreshToken()
null
if there is no associated refresh token.public void setRefreshToken(RefreshToken refreshToken)
refreshToken
- The refresh token associated with this access token.public int hashCode()
hashCode
in class Token
public boolean equals(java.lang.Object o)
equals
in class Token
o
- The object for which to make the determination.
true
if the provided object is equal to this authorization
code, or false
if not.protected void toString(java.lang.StringBuilder buffer)
toString
in class Token
buffer
- The buffer to which the string representation should be
appended.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |