com.unboundid.directory.sdk.broker.types
Class AuthorizationCode

java.lang.Object
  extended by com.unboundid.directory.sdk.broker.types.AuthorizationCode

@NotExtensible
@Mutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class AuthorizationCode
extends java.lang.Object

This class provides a data structure for working with OAuth2 temporary authorization codes.


Constructor Summary
AuthorizationCode(java.lang.String userId, java.lang.String applicationId, java.lang.String redirectUri, java.util.Date generateTimestamp, long maxValiditySeconds, java.util.Set<java.lang.String> scopeIds, java.lang.String state, long authTime)
          Construct a new authorization code instance.
 
Method Summary
 boolean equals(java.lang.Object o)
          Indicates whether the provided object is equal to this authorization code.
 java.lang.String getApplicationId()
          Retrieves the application ID with which this authorization code is associated.
 long getAuthTime()
          Retrieves the time that the user authenticated with the server.
 java.util.Date getGenerateTimestamp()
          Retrieves the time that this authorization code was generated.
 long getMaxValiditySeconds()
          Retrieves the maximum length of time in seconds that this code will be considered valid.
 java.lang.String getRedirectUri()
          Returns the endpoint to redirect the resource owner's user-agent back to the application.
 java.util.Set<java.lang.String> getScopeIds()
          Retrieves the set of scope IDs for which the client has been authorized.
 java.lang.String getState()
          Retrieves the opaque value used by the client to maintain state between the request and callback.
 java.lang.String getUserId()
          Retrieves the user ID of the resource owner this authorization code is associated with.
 java.lang.String getValue()
          Retrieves the string value of this authorization code that should be returned to the client.
 int hashCode()
          Retrieves a hash code for this authorization code.
 boolean isExpired()
          Indicates whether this authorization code is expired.
 void setValue(java.lang.String value)
          Sets the string value of this authorization code that should be returned to the client.
 java.lang.String toString()
          Retrieves a string representation of this authorization code.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AuthorizationCode

public AuthorizationCode(java.lang.String userId,
                         java.lang.String applicationId,
                         java.lang.String redirectUri,
                         java.util.Date generateTimestamp,
                         long maxValiditySeconds,
                         java.util.Set<java.lang.String> scopeIds,
                         java.lang.String state,
                         long authTime)
Construct a new authorization code instance.

Parameters:
userId - The user ID of the resource owner this authorization code is associated with. Must not be null.
applicationId - The application ID with which this token is associated. Must not be null.
redirectUri - the endpoint to redirect the resource owner's user-agent back to the application. 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.
scopeIds - The set of scopes for which the client has been authorized. Must not be null.
state - The opaque value used by the client to maintain state between the request and callback.
authTime - The time at which the resource owner was authenticated with the Identity Broker, in milliseconds since 1/1/70 12:00 AM.
Method Detail

getUserId

public java.lang.String getUserId()
Retrieves the user ID of the resource owner this authorization code is associated with.

Returns:
The user ID of the resource owner this authorization code is associated with.

getApplicationId

public java.lang.String getApplicationId()
Retrieves the application ID with which this authorization code is associated.

Returns:
The application ID with which this authorization code is associated.

getScopeIds

public java.util.Set<java.lang.String> getScopeIds()
Retrieves the set of scope IDs for which the client has been authorized.

Returns:
The set of scope IDs for which the client has been authorized.

getGenerateTimestamp

public java.util.Date getGenerateTimestamp()
Retrieves the time that this authorization code was generated.

Returns:
The time that this authorization code was generated.

getMaxValiditySeconds

public long getMaxValiditySeconds()
Retrieves the maximum length of time in seconds that this code will be considered valid.

Returns:
The maximum length of time in seconds that this code will be considered valid.

getState

public java.lang.String getState()
Retrieves the opaque value used by the client to maintain state between the request and callback.

Returns:
The opaque value used by the client to maintain state between the request and callback or null if it was not used.

getRedirectUri

public java.lang.String getRedirectUri()
Returns the endpoint to redirect the resource owner's user-agent back to the application.

Returns:
The endpoint to redirect the resource owner's user-agent back to the application.

getAuthTime

public long getAuthTime()
Retrieves the time that the user authenticated with the server.

Returns:
Authentication time in milliseconds since midnight 1/1/1970 GMT.

getValue

public java.lang.String getValue()
Retrieves the string value of this authorization code that should be returned to the client.

Returns:
The string value of this authorization code that should be returned to the client.

setValue

public void setValue(java.lang.String value)
Sets the string value of this authorization code that should be returned to the client.

Parameters:
value - The string value of this authorization code that should be returned to the client.

isExpired

public boolean isExpired()
Indicates whether this authorization code is expired.

Returns:
true if this authorization code is expired, or false if not.

hashCode

public int hashCode()
Retrieves a hash code for this authorization code.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code for this authorization code.

equals

public boolean equals(java.lang.Object o)
Indicates whether the provided object is equal to this authorization code.

Overrides:
equals in class java.lang.Object
Parameters:
o - The object for which to make the determination.
Returns:
true if the provided object is equal to this authorization code, or false if not.

toString

public java.lang.String toString()
Retrieves a string representation of this authorization code.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this authorization code.