Class OAuth2RefreshToken

  • All Implemented Interfaces:
    Serializable, org.springframework.security.oauth2.core.OAuth2Token

    public class OAuth2RefreshToken
    extends org.springframework.security.oauth2.core.OAuth2RefreshToken
    The OAuth2RefreshToken class holds the information for an OAuth2 refresh token.
    Author:
    Marcus Portmann
    See Also:
    Serialized Form
    • Constructor Detail

      • OAuth2RefreshToken

        public OAuth2RefreshToken​(String tokenValue,
                                  Instant issuedAt)
        Constructs a new OAuth2RefreshToken.
        Parameters:
        tokenValue - the token value
        issuedAt - the time at which the token was issued
    • Method Detail

      • build

        public static OAuth2RefreshToken build​(String username,
                                               Set<String> scopes,
                                               int validFor,
                                               RSAPrivateKey rsaPrivateKey)
        Build a new OAuth2RefreshToken.
        Parameters:
        username - the username for the user the token is being issued for
        scopes - the optional scope(s) associated to the token
        validFor - the number of seconds the token should be valid for
        rsaPrivateKey - the RSA private key used to sign the token
        Returns:
        the OAuth2 refresh token