Class DeviceCode

  • All Implemented Interfaces:
    Cloneable, Iterable<org.forgerock.json.JsonValue>, Token

    public class DeviceCode
    extends org.forgerock.json.JsonValue
    implements Token
    Models a OpenAm OAuth2 Authorization Code.
    Since:
    13.0.0
    • Method Detail

      • getDeviceCode

        public String getDeviceCode()
        Gets the Device Code - this is also the Token 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: Token
        Gets the token's identifier.
        Specified by:
        getTokenId in interface Token
        Returns:
        The token's id.
      • getAuditTrackingId

        public String getAuditTrackingId()
        Description copied from interface: Token
        Get the audit tracking ID for this token.
        Specified by:
        getAuditTrackingId in interface Token
        Returns:
        The tracking ID.
      • getTokenName

        public String getTokenName()
        Description copied from interface: Token
        Gets the token's name.
        Specified by:
        getTokenName in interface Token
        Returns:
        The token's name.
      • getExpiryTime

        public long getExpiryTime()
        Gets the expiry time of this device code.
        Returns:
        The expiry time (ms since epoch).
      • getScope

        public Set<String> getScope()
        Gets the set of scopes requested.
        Returns:
        The scope values.
      • isIssued

        public boolean isIssued()
        Whether this device code has been issued.
      • toMap

        public Map<String,​Object> toMap()
                                       throws ServerException
        Description copied from interface: Token
        Converts the token into a Map of its key data.
        Specified by:
        toMap in interface Token
        Returns:
        A Map of the token's key data.
        Throws:
        ServerException - If any internal server error occurs.
      • getTokenInfo

        public Map<String,​Object> getTokenInfo()
        Description copied from interface: Token
        Gets the token's information.
        Specified by:
        getTokenInfo in interface Token
        Returns:
        A Map of the token's information.
      • getStringProperty

        protected String getStringProperty​(String key)
      • setAuthorized

        public void setAuthorized​(boolean authorized)
      • isAuthorized

        public boolean isAuthorized()
      • toJsonValue

        public org.forgerock.json.JsonValue toJsonValue()
        Gets the JsonValue representation of the token.
        Specified by:
        toJsonValue in interface Token
        Returns:
        The JsonValue representation of the token.