Package org.forgerock.oauth2.core
Class DeviceCode
- java.lang.Object
 - 
- org.forgerock.json.JsonValue
 - 
- org.forgerock.oauth2.core.DeviceCode
 
 
 
- 
- 
Constructor Summary
Constructors Constructor Description DeviceCode(String deviceCode, String userCode, String resourceOwnerId, String clientId, String nonce, String responseType, String state, String acrValues, String prompt, String uiLocales, String loginHint, Integer maxAge, String claims, long expiryTime, Set<String> scope, String realm, String codeChallenge, String codeChallengeMethod, String auditTrackingId)DeviceCode(org.forgerock.json.JsonValue token)Constructs a new OpenAMAuthorizationCode backed with the data in the specified JsonValue. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAcrValues()Gets the ACR Values parameter.StringgetAuditTrackingId()Get the audit tracking ID for this token.AuditConstants.TrackingIdKeygetAuditTrackingIdKey()Get the audit tracking ID key for this token.StringgetClaims()Returns the requested claims.StringgetClientId()Gets the Client ID parameter.StringgetCodeChallenge()Gets the Code Challenge parameter.StringgetCodeChallengeMethod()Gets the Code Challenge Method parameter.StringgetDeviceCode()Gets the Device Code - this is also theToken ID.longgetExpiryTime()Gets the expiry time of this device code.longgetLastPollTime()Gets the time that this device code was last polled by the device.StringgetLoginHint()Gets the login hint parameter.IntegergetMaxAge()Gets the max age parameter.StringgetNonce()Gets the Nonce parameter.StringgetPrompt()Gets the prompt parameter.StringgetRealm()Gets the realm.StringgetResourceOwnerId()Gets the Resource Owner ID parameter.StringgetResponseType()Gets the response type parameter.Set<String>getScope()Gets the set of scopes requested.StringgetState()Gets the state parameter.protected StringgetStringProperty(String key)StringgetTokenId()Gets the token's identifier.Map<String,Object>getTokenInfo()Gets the token's information.StringgetTokenName()Gets the token's name.StringgetUiLocales()Gets the UI Locales parameter.StringgetUserCode()Gets the User Code.booleanisAuthorized()booleanisIssued()Whether this device code has been issued.voidpoll()Updates the last poll time of this device code.voidsetAuthorized(boolean authorized)voidsetResourceOwnerId(String resourceOwnerId)Sets the Resource Owner ID parameter.org.forgerock.json.JsonValuetoJsonValue()Gets theJsonValuerepresentation of the token.Map<String,Object>toMap()Converts the token into aMapof its key data.- 
Methods inherited from class org.forgerock.json.JsonValue
add, add, add, add, addPermissive, array, as, asBigDecimal, asBoolean, asCollection, asCollection, asDouble, asEnum, asInteger, asList, asList, asLong, asMap, asMap, asMapOfList, asNumber, asSet, asSet, asString, asURI, clear, clone, contains, copy, defaultTo, diff, expect, field, fieldIfNotNull, get, get, get, getObject, getPointer, isBoolean, isCollection, isDefined, isEqualTo, isList, isMap, isNotNull, isNull, isNumber, isSet, isString, iterator, json, keys, object, object, patch, put, put, put, putPermissive, remove, remove, remove, required, set, setObject, size, toIndex, toString 
- 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 
- 
Methods inherited from interface java.lang.Iterable
forEach, spliterator 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
DeviceCode
public DeviceCode(org.forgerock.json.JsonValue token) throws InvalidGrantExceptionConstructs a new OpenAMAuthorizationCode backed with the data in the specified JsonValue.- Parameters:
 token- The JsonValue of the token.- Throws:
 InvalidGrantException- If the given token is not an Authorization Code token.
 
- 
DeviceCode
public DeviceCode(String deviceCode, String userCode, String resourceOwnerId, String clientId, String nonce, String responseType, String state, String acrValues, String prompt, String uiLocales, String loginHint, Integer maxAge, String claims, long expiryTime, Set<String> scope, String realm, String codeChallenge, String codeChallengeMethod, String auditTrackingId)
 
 - 
 
- 
Method Detail
- 
getDeviceCode
public String getDeviceCode()
Gets the Device Code - this is also theToken ID.- Returns:
 - The device code.
 
 
- 
getUserCode
public String getUserCode()
Gets the User Code.- Returns:
 - The user code.
 
 
- 
getResourceOwnerId
public String getResourceOwnerId()
Gets the Resource Owner ID parameter.- Returns:
 - The Resource Owner ID.
 
 
- 
setResourceOwnerId
public void setResourceOwnerId(String resourceOwnerId)
Sets the Resource Owner ID parameter.- Parameters:
 resourceOwnerId- The Resource Owner ID.
 
- 
getClientId
public String getClientId()
Gets the Client ID parameter.- Returns:
 - The Client ID.
 
 
- 
getNonce
public String getNonce()
Gets the Nonce parameter.- Returns:
 - The nonce.
 
 
- 
getAcrValues
public String getAcrValues()
Gets the ACR Values parameter.- Returns:
 - The ACR Values String.
 
 
- 
getCodeChallengeMethod
public String getCodeChallengeMethod()
Gets the Code Challenge Method parameter.- Returns:
 - The code challenge method.
 
 
- 
getCodeChallenge
public String getCodeChallenge()
Gets the Code Challenge parameter.- Returns:
 - The code challenge.
 
 
- 
getMaxAge
public Integer getMaxAge()
Gets the max age parameter.- Returns:
 - The max age.
 
 
- 
getLoginHint
public String getLoginHint()
Gets the login hint parameter.- Returns:
 - The login hint.
 
 
- 
getUiLocales
public String getUiLocales()
Gets the UI Locales parameter.- Returns:
 - The ui locales.
 
 
- 
getPrompt
public String getPrompt()
Gets the prompt parameter.- Returns:
 - The prompt.
 
 
- 
getState
public String getState()
Gets the state parameter.- Returns:
 - The state.
 
 
- 
getResponseType
public String getResponseType()
Gets the response type parameter.- Returns:
 - The response type.
 
 
- 
getClaims
public String getClaims()
Returns the requested claims.- Returns:
 - The requested claims.
 
 
- 
poll
public void poll()
Updates the last poll time of this device code. 
- 
getLastPollTime
public long getLastPollTime()
Gets the time that this device code was last polled by the device.- Returns:
 - The last poll time in milliseconds.
 
 
- 
getRealm
public String getRealm()
Gets the realm.- Returns:
 - The realm.
 
 
- 
getTokenId
public String getTokenId()
Description copied from interface:TokenGets the token's identifier.- Specified by:
 getTokenIdin interfaceToken- Returns:
 - The token's id.
 
 
- 
getAuditTrackingId
public String getAuditTrackingId()
Description copied from interface:TokenGet the audit tracking ID for this token.- Specified by:
 getAuditTrackingIdin interfaceToken- Returns:
 - The tracking ID.
 
 
- 
getAuditTrackingIdKey
public AuditConstants.TrackingIdKey getAuditTrackingIdKey()
Description copied from interface:TokenGet the audit tracking ID key for this token.- Specified by:
 getAuditTrackingIdKeyin interfaceToken- Returns:
 - The tracking ID key.
 
 
- 
getTokenName
public String getTokenName()
Description copied from interface:TokenGets the token's name.- Specified by:
 getTokenNamein interfaceToken- Returns:
 - The token's name.
 
 
- 
getExpiryTime
public long getExpiryTime()
Gets the expiry time of this device code.- Returns:
 - The expiry time (ms since epoch).
 
 
- 
isIssued
public boolean isIssued()
Whether this device code has been issued. 
- 
toMap
public Map<String,Object> toMap() throws ServerException
Description copied from interface:TokenConverts the token into aMapof its key data.- Specified by:
 toMapin interfaceToken- Returns:
 - A 
Mapof the token's key data. - Throws:
 ServerException- If any internal server error occurs.
 
- 
getTokenInfo
public Map<String,Object> getTokenInfo()
Description copied from interface:TokenGets the token's information.- Specified by:
 getTokenInfoin interfaceToken- Returns:
 - A 
Mapof the token's information. 
 
- 
setAuthorized
public void setAuthorized(boolean authorized)
 
- 
isAuthorized
public boolean isAuthorized()
 
- 
toJsonValue
public org.forgerock.json.JsonValue toJsonValue()
Gets theJsonValuerepresentation of the token.- Specified by:
 toJsonValuein interfaceToken- Returns:
 - The 
JsonValuerepresentation of the token. 
 
 - 
 
 -