public enum ResponseType extends Enum<ResponseType>
response_type.
From RFC 6749 (OAuth 2.0), 3.1.1. Response Type
response_type- REQUIRED. The value MUST be one of
"code"for requesting an authorization code as described by Section 4.1.1,"token"for requesting an access token (implicit grant) as described by Section 4.2.1, or a registered extension value as described by Section 8.4.
From OAuth 2.0 Multiple Response Type Encoding Practices, 3. ID Token Response Type
id_token- When supplied as the
response_typeparameter in an OAuth 2.0 Authorization Request, a successful response MUST include the parameterid_token. The Authorization Server SHOULD NOT return an OAuth 2.0 Authorization Code, Access Token, or Access Token Type in a successful response to the grant request. If aredirect_uriis supplied, the User Agent SHOULD be redirected there after granting or denying access. The request MAY include astateparameter, and if so, the Authorization Server MUST echo its value as a response parameter when issuing either a successful response or an error response. The default Response Mode for this Response Type is the fragment encoding and the query encoding MUST NOT be used. Both successful and error responses SHOULD be returned using the supplied Response Mode, or if none is supplied, using the default Response Mode.
From OAuth 2.0 Multiple Response Type Encoding Practices, 4. None Response Type
none- When supplied as the
response_typeparameter in an OAuth 2.0 Authorization Request, the Authorization Server SHOULD NOT return an OAuth 2.0 Authorization Code, Access Token, Access Token Type, or ID Token in a successful response to the grant request. If aredirect_uriis supplied, the User Agent SHOULD be redirected there after granting or denying access. The request MAY include astateparameter, and if so, the Authorization Server MUST echo its value as a response parameter when issuing either a successful response or an error response. The default Response Mode for this Response Type is the query encoding. Both successful and error responses SHOULD be returned using the supplied Response Mode, or if none is supplied, using the default Response Mode.
From OAuth 2.0 Multiple Response Type Encoding Practices, 5. Definitions of Multiple-Valued Response Type Combinations
code token- When supplied as the value for the
response_typeparameter, a successful response MUST include an Access Token, an Access Token Type, and an Authorization Code. The default Response Mode for this Response Type is the fragment encoding and the query encoding MUST NOT be used. Both successful and error responses SHOULD be returned using the supplied Response Mode, or if none is supplied, using the default Response Mode.
code id_token- When supplied as the value for the
response_typeparameter, a successful response MUST include both an Authorization Code and anid_token. The default Response Mode for this Response Type is the fragment encoding and the query encoding MUST NOT be used. Both successful and error responses SHOULD be returned using the supplied Response Mode, or if none is supplied, using the default Response Mode.
id_token token- When supplied as the value for the
response_typeparameter, a successful response MUST include an Access Token, an Access Token Type, and anid_token. The default Response Mode for this Response Type is the fragment encoding and the query encoding MUST NOT be used. Both successful and error responses SHOULD be returned using the supplied Response Mode, or if none is supplied, using the default Response Mode.
code id_token token- When supplied as the value for the
response_typeparameter, a successful response MUST include an Authorization Code, anid_token, an Access Token, and an Access Token Type. The default Response Mode for this Response Type is the fragment encoding and the query encoding MUST NOT be used. Both successful and error responses SHOULD be returned using the supplied Response Mode, or if none is supplied, using the default Response Mode.
| Enum Constant and Description |
|---|
CODE
"code" (1), a response_type to request an authorization code. |
CODE_ID_TOKEN
"code id_token" (5), a response_type to request
an authorization code and an ID token. |
CODE_ID_TOKEN_TOKEN
"code id_token token" (7), a response_type to request
an authorization code, an ID token and an access token. |
CODE_TOKEN
"code token" (4), a response_type to request
an authorization code and an access token. |
ID_TOKEN
"id_token" (3), a response_type to request an ID token. |
ID_TOKEN_TOKEN
"id_token token" (6), a response_type to request
an ID token and an access token. |
NONE
"none" (0), a response_type to request no access credentials. |
TOKEN
"token" (2), a response_type to request an access token. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsCode()
Check if this response type contains a request for
an authorization code.
|
boolean |
containsIdToken()
Check if this response type contains a request for an ID token.
|
boolean |
containsToken()
Check if this response type contains a request for an access token.
|
static ResponseType |
getByValue(short value)
Find an instance of this enum by a value.
|
short |
getValue()
Get the integer representation of this enum instance.
|
static ResponseType |
parse(String responseType)
Parse a space-separated
response_type values. |
boolean |
requiresImplicitFlow()
Check if this response type requires the Implicit Flow.
|
static ResponseType[] |
toArray(int bits) |
static int |
toBits(EnumSet<ResponseType> set) |
static EnumSet<ResponseType> |
toSet(int bits) |
static EnumSet<ResponseType> |
toSet(ResponseType[] array) |
String |
toString() |
static ResponseType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ResponseType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ResponseType NONE
"none" (0), a response_type to request no access credentials.public static final ResponseType CODE
"code" (1), a response_type to request an authorization code.public static final ResponseType TOKEN
"token" (2), a response_type to request an access token.public static final ResponseType ID_TOKEN
"id_token" (3), a response_type to request an ID token.public static final ResponseType CODE_TOKEN
"code token" (4), a response_type to request
an authorization code and an access token.public static final ResponseType CODE_ID_TOKEN
"code id_token" (5), a response_type to request
an authorization code and an ID token.public static final ResponseType ID_TOKEN_TOKEN
"id_token token" (6), a response_type to request
an ID token and an access token.public static final ResponseType CODE_ID_TOKEN_TOKEN
"code id_token token" (7), a response_type to request
an authorization code, an ID token and an access token.public static ResponseType[] values()
for (ResponseType c : ResponseType.values()) System.out.println(c);
public static ResponseType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic short getValue()
public String toString()
toString in class Enum<ResponseType>public boolean containsCode()
public boolean containsIdToken()
public boolean containsToken()
public boolean requiresImplicitFlow()
token or id_token.true if this response type requires the Implicit Flow.public static ResponseType getByValue(short value)
value - The integer representation of the instance to find.null if not found.public static ResponseType parse(String responseType)
response_type values.responseType - A response type. For example, "code id_token".ResponseType instance, or null.public static int toBits(EnumSet<ResponseType> set)
public static ResponseType[] toArray(int bits)
public static EnumSet<ResponseType> toSet(int bits)
public static EnumSet<ResponseType> toSet(ResponseType[] array)
Copyright © 2017. All rights reserved.