Package com.nimbusds.oauth2.sdk
Class RefreshTokenGrant
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.AuthorizationGrant
-
- com.nimbusds.oauth2.sdk.RefreshTokenGrant
-
@Immutable public class RefreshTokenGrant extends AuthorizationGrant
Refresh token grant. Used in refresh token requests.Note that the optional scope parameter is not supported.
Related specifications:
- OAuth 2.0 (RFC 6749), section 6.
-
-
Field Summary
Fields Modifier and Type Field Description static GrantType
GRANT_TYPE
The grant type.
-
Constructor Summary
Constructors Constructor Description RefreshTokenGrant(RefreshToken refreshToken)
Creates a new refresh token grant.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
RefreshToken
getRefreshToken()
Gets the refresh token.int
hashCode()
static RefreshTokenGrant
parse(Map<String,List<String>> params)
Parses a refresh token grant from the specified request body parameters.Map<String,List<String>>
toParameters()
Returns the request body parameters for the authorisation grant.-
Methods inherited from class com.nimbusds.oauth2.sdk.AuthorizationGrant
getType
-
-
-
-
Field Detail
-
GRANT_TYPE
public static final GrantType GRANT_TYPE
The grant type.
-
-
Constructor Detail
-
RefreshTokenGrant
public RefreshTokenGrant(RefreshToken refreshToken)
Creates a new refresh token grant.- Parameters:
refreshToken
- The refresh token. Must not benull
.
-
-
Method Detail
-
getRefreshToken
public RefreshToken getRefreshToken()
Gets the refresh token.- Returns:
- The refresh token.
-
toParameters
public Map<String,List<String>> toParameters()
Description copied from class:AuthorizationGrant
Returns the request body parameters for the authorisation grant.- Specified by:
toParameters
in classAuthorizationGrant
- Returns:
- The parameters.
-
parse
public static RefreshTokenGrant parse(Map<String,List<String>> params) throws ParseException
Parses a refresh token grant from the specified request body parameters.Example:
grant_type=refresh_token refresh_token=tGzv3JOkF0XG5Qx2TlKWIA
- Parameters:
params
- The parameters.- Returns:
- The refresh token grant.
- Throws:
ParseException
- If parsing failed.
-
-