public enum ResponseMode extends Enum<ResponseMode>
response_mode.
From OAuth 2.0 Multiple Response Type Encoding Practices, 2.1. Response Modes
query- In this mode, Authorization Response parameters are encoded in the query string added to the
redirect_uriwhen redirecting back to the Client.
fragment- In this mode, Authorization Response parameters are encoded in the fragment added to the
redirect_uriwhen redirecting back to the Client.
From OAuth 2.0 Form Post Response Mode
form_post- In this mode, Authorization Response parameters are encoded as HTML form values that are auto-submitted in the User Agent, and thus are transmitted via the HTTP
POSTmethod to the Client, with the result parameters being encoded in the body using theapplication/x-www-form-urlencodedformat. The action attribute of the form MUST be the Client's Redirection URI. The method of the form attribute MUST bePOST.
Any technique supported by the User Agent MAY be used to cause the submission of the form, and any form content necessary to support this MAY be included, such as submit controls and client-side scripting commands. However, the Client MUST be able to process the message without regard for the mechanism by which the form submission was initiated.
From Financial-grade API: JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)
jwt- In this mode, Authorization Response parameters are packed into a JWT and the resultant JWT is embedded in the default place (the query part of the redirect URI, the fragment part of the redirect URI, or the HTML form in the response body).
query.jwt- In this mode, Authorization Response parameters are packed into a JWT and the resultant JWT is embedded in the query part of the redirect URI.
fragment.jwt- In this mode, Authorization Response parameters are packed into a JWT and the resultant JWT is embedded in the fragment part of the redirect URI.
form_post.jwt- In this mode, Authorization Response parameters are packed into a JWT and the resultant JWT is embedded in the HTML form in the response body.
| Enum Constant and Description |
|---|
FORM_POST
"form_post" (3); response_mode to request authorization
response parameters be encoded as HTML form values. |
FORM_POST_JWT
"form_post.jwt" (7); response_mode to request authorization
response parameters be encoded as JWT and embedded in the HTML form in the
response body. |
FRAGMENT
"fragment" (2); response_mode to request authorization
response parameters be encoded in the fragment. |
FRAGMENT_JWT
"fragment.jwt" (6); response_mode to request authorization
response parameters be encoded as JWT and embedded in the fragment part of
the redirect URI. |
JWT
"jwt" (4); response_mode to request authorization response
parameters be encoded as JWT and embedded in the default part. |
QUERY
"query" (1); response_mode to request authorization
response parameters be encoded in the query string. |
QUERY_JWT
"query.jwt" (5); response_mode to request authorization
response parameters be encoded as JWT and embedded in the query part of
the redirect URI. |
| Modifier and Type | Method and Description |
|---|---|
static ResponseMode |
getByValue(short value)
Find an instance of this enum by a value.
|
short |
getValue()
Get the integer representation of this enum instance.
|
boolean |
isFormPostRequired()
Check whether this response mode requires response parameters be
embedded in the HTML form in the response body.
|
boolean |
isFragmentRequired()
Check whether this response mode requires response parameters be
embedded in the fragment part of the redirect URI.
|
boolean |
isJwtRequired()
Check whether this response mode requires response parameters be
packed into a JWT.
|
boolean |
isQueryRequired()
Check whether this response mode requires response parameters be
embedded in the query part of the redirect URI.
|
static ResponseMode |
parse(String responseMode)
Convert
String to ResponseMode. |
static ResponseMode[] |
toArray(int bits) |
static int |
toBits(EnumSet<ResponseMode> set) |
static EnumSet<ResponseMode> |
toSet(int bits) |
static EnumSet<ResponseMode> |
toSet(ResponseMode[] array) |
String |
toString() |
static ResponseMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ResponseMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
ResponseMode |
withJwt()
Get the
ResponseMode instance corresponding to this instance
that requires JWT. |
ResponseMode |
withoutJwt()
Get the
ResponseMode instance corresponding to this instance
that does not require JWT. |
public static final ResponseMode QUERY
"query" (1); response_mode to request authorization
response parameters be encoded in the query string.public static final ResponseMode FRAGMENT
"fragment" (2); response_mode to request authorization
response parameters be encoded in the fragment.public static final ResponseMode FORM_POST
"form_post" (3); response_mode to request authorization
response parameters be encoded as HTML form values.public static final ResponseMode JWT
"jwt" (4); response_mode to request authorization response
parameters be encoded as JWT and embedded in the default part. This is a
shortcut of "{default}.jwt".public static final ResponseMode QUERY_JWT
"query.jwt" (5); response_mode to request authorization
response parameters be encoded as JWT and embedded in the query part of
the redirect URI.public static final ResponseMode FRAGMENT_JWT
"fragment.jwt" (6); response_mode to request authorization
response parameters be encoded as JWT and embedded in the fragment part of
the redirect URI.public static final ResponseMode FORM_POST_JWT
"form_post.jwt" (7); response_mode to request authorization
response parameters be encoded as JWT and embedded in the HTML form in the
response body.public static ResponseMode[] values()
for (ResponseMode c : ResponseMode.values()) System.out.println(c);
public static ResponseMode 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<ResponseMode>public static ResponseMode getByValue(short value)
value - The integer representation of the instance to find.null if not found.public boolean isJwtRequired()
true if this response mode is one of JWT,
QUERY_JWT, FRAGMENT_JWT and
FORM_POST_JWT.public boolean isQueryRequired()
public boolean isFragmentRequired()
true if this response mode is either FRAGMENT or
FRAGMENT_JWT. Otherwise, false.public boolean isFormPostRequired()
true if this response mode is either FORM_POST
or FORM_POST_JWT.public ResponseMode withJwt()
ResponseMode instance corresponding to this instance
that requires JWT.
thisinstancereturned instance QUERYQUERY_JWTFRAGMENTFRAGMENT_JWTFORM_POSTFORM_POST_JWTJWTJWTQUERY_JWTQUERY_JWTFRAGMENT_JWTFRAGMENT_JWTFORM_POST_JWTFORM_POST_JWT
ResponseMode instance corresponding to this instance
that requires JWT.public ResponseMode withoutJwt()
ResponseMode instance corresponding to this instance
that does not require JWT. Note that if this instance is JWT,
this method returns null.
thisinstancereturned instance QUERYQUERYFRAGMENTFRAGMENTFORM_POSTFORM_POSTJWTnullQUERY_JWTQUERYFRAGMENT_JWTFRAGMENTFORM_POST_JWTFORM_POST
ResponseMode instance corresponding to this instance
that does not require JWT.public static ResponseMode parse(String responseMode)
String to ResponseMode.responseMode - A response mode. For example, "query".ResponseMode instance, or null.public static int toBits(EnumSet<ResponseMode> set)
public static ResponseMode[] toArray(int bits)
public static EnumSet<ResponseMode> toSet(int bits)
public static EnumSet<ResponseMode> toSet(ResponseMode[] array)
Copyright © 2019. All rights reserved.