Class StatefulRefreshToken

    • Constructor Detail

      • StatefulRefreshToken

        public StatefulRefreshToken​(org.forgerock.json.JsonValue token)
                             throws InvalidGrantException
        Constructs a new RefreshToken backed with the data in the specified JsonValue.
        Parameters:
        token - The JsonValue of the token.
        Throws:
        InvalidGrantException - If the given token is not a Refresh Token.
      • StatefulRefreshToken

        public StatefulRefreshToken​(String id,
                                    String resourceOwnerId,
                                    String clientId,
                                    String redirectUri,
                                    Set<String> scope,
                                    long expiryTime,
                                    String tokenType,
                                    String tokenName,
                                    String grantType,
                                    String realm,
                                    String authModules,
                                    String acr,
                                    String auditId,
                                    String authGrantId)
        Constructs a new RefreshToken.
        Parameters:
        id - The token id.
        resourceOwnerId - The resource owner's id.
        clientId - The client's id.
        redirectUri - The redirect uri.
        scope - The scope.
        expiryTime - The expiry time.
        tokenType - The token type.
        tokenName - The token name.
        grantType - The grant type.
        realm - The realm.
        authModules - The pipe-separated list of auth modules.
        acr - The authentication context.
        auditId - The audit id, used for tracking tokens throughout the audit logs.
        authGrantId - The authorization grant id.
      • StatefulRefreshToken

        public StatefulRefreshToken​(String id,
                                    String resourceOwnerId,
                                    String clientId,
                                    String redirectUri,
                                    Set<String> scope,
                                    long expiryTime,
                                    String tokenType,
                                    String tokenName,
                                    String grantType,
                                    String realm,
                                    String authModules,
                                    String acr,
                                    String auditId,
                                    String authGrantId,
                                    long authTime)
        Constructs a new RefreshToken.
        Parameters:
        id - The token id.
        resourceOwnerId - The resource owner's id.
        clientId - The client's id.
        redirectUri - The redirect uri.
        scope - The scope.
        expiryTime - The expiry time.
        tokenType - The token type.
        tokenName - The token name.
        grantType - The grant type.
        realm - The realm.
        authModules - The pipe-separated list of auth modules.
        acr - The authentication context.
        auditId - The audit id, used for tracking tokens throughout the audit logs.
        authGrantId - The authorization grant id.
        authTime - The end user's original auth time in seconds.
    • Method Detail

      • setClaims

        public void setClaims​(String claims)
        Sets the requested claims.
        Parameters:
        claims - Requested claims
      • setScope

        protected void setScope​(Set<String> scope)
        Sets the scope.
        Overrides:
        setScope in class StatefulToken
        Parameters:
        scope - The scope.
      • setExpiryTime

        protected void setExpiryTime​(long expiryTime)
        Sets the expiry time.
        Overrides:
        setExpiryTime in class StatefulToken
        Parameters:
        expiryTime - The expiry time.
      • getResourceString

        protected String getResourceString​(String s)
        Gets the display String for the given String.
        Overrides:
        getResourceString in class StatefulToken
        Parameters:
        s - The String.
        Returns:
        The display String.
      • setAuthModules

        protected void setAuthModules​(String authModules)
        Sets the auth modules used for authentication.
        Parameters:
        authModules - A pipe-delimited string of auth module names.
      • setAuthenticationContextClassReference

        protected void setAuthenticationContextClassReference​(String acr)
        Sets the authentication context class reference (acr).
        Parameters:
        acr - The acr.
      • getRedirectUri

        public String getRedirectUri()
        Gets the client's redirect uri.
        Specified by:
        getRedirectUri in interface RefreshToken
        Returns:
        The client's redirect uri.
      • isExpired

        public boolean isExpired()
        Determines if the Refresh Token has expired.
        Specified by:
        isExpired in interface IntrospectableToken
        Overrides:
        isExpired in class StatefulToken
        Returns:
        true if current time is greater than the expiry time.
      • getAuthModules

        public String getAuthModules()
        Gets the auth modules used for authentication.
        Specified by:
        getAuthModules in interface RefreshToken
        Returns:
        A pipe-delimited string of auth module names.
      • toMap

        public Map<String,​Object> toMap()
        Description copied from interface: Token
        Converts the token into a Map of its key data.
        Specified by:
        toMap in interface RefreshToken
        Specified by:
        toMap in interface Token
        Returns:
        A Map of the token's key data.
      • 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.
      • getAuthGrantId

        public String getAuthGrantId()
        Description copied from interface: RefreshToken
        Gets the token's Auth Grant id.
        Specified by:
        getAuthGrantId in interface RefreshToken
        Returns:
        The token's Auth Grant id.
      • setAuditTrackingId

        protected void setAuditTrackingId​(String auditId)
        Sets the audit id.
        Parameters:
        auditId - The audit id.
      • setAuthTime

        protected void setAuthTime​(long authTime)
        Sets the end user's original authentication time in seconds since epoch.
        Overrides:
        setAuthTime in class StatefulToken
        Parameters:
        authTime - The authentication time.
      • toString

        public String toString()
        Overrides:
        toString in class org.forgerock.json.JsonValue