Serializable, Cloneable, Iterable<ResponseType.Value>, Collection<ResponseType.Value>, Set<ResponseType.Value>@NotThreadSafe public class ResponseType extends HashSet<ResponseType.Value>
The following helper methods can be used to find out the OAuth 2.0 protocol flow that a particular response type implies:
Example response type implying an authorisation code flow:
ResponseType() rt = new ResponseType(); rt.add(ResponseType.Value.CODE);
Example response type from OpenID Connect specifying an ID token and an access token (implies implicit flow):
ResponseType() rt = new ResponseType(); rt.add(OIDCResponseTypeValue.ID_TOKEN); rt.add(ResponseType.Value.TOKEN);
Related specifications:
| Modifier and Type | Class | Description |
|---|---|---|
static class |
ResponseType.Value |
Authorisation response type value.
|
| Constructor | Description |
|---|---|
ResponseType() |
Creates a new empty response type.
|
ResponseType(ResponseType.Value... values) |
Creates a new response type with the specified values.
|
ResponseType(String... values) |
Creates a new response type with the specified string values.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
contains(String value) |
Checks if this response type contains the specified string value.
|
static ResponseType |
getDefault() |
Gets the default response type.
|
boolean |
impliesCodeFlow() |
Returns
true if this response type implies an authorisation
code flow. |
boolean |
impliesHybridFlow() |
Returns
true if this response type implies an OpenID Connect
hybrid flow. |
boolean |
impliesImplicitFlow() |
Returns
true if this response type implies an implicit flow. |
static ResponseType |
parse(String s) |
Parses a set of authorisation response types.
|
String |
toString() |
Returns the string representation of this authorisation response
type.
|
addAll, containsAll, retainAll, toArray, toArrayequals, hashCode, removeAllparallelStream, removeIf, streamadd, clear, clone, contains, isEmpty, iterator, remove, size, spliteratorpublic ResponseType()
public ResponseType(String... values)
values - The string values. Must not be null.public ResponseType(ResponseType.Value... values)
values - The values. Must not be null.public static ResponseType getDefault()
ResponseType.Value.CODE.public static ResponseType parse(String s) throws ParseException
Example serialised response type sets:
code token id_token id_token token code token code id_token code id_token token
s - Space-delimited list of one or more authorisation response
types.ParseException - If the parsed string is null or
empty.public boolean impliesCodeFlow()
true if this response type implies an authorisation
code flow.
Code flow response_type values: code
true if a code flow is implied, else false.public boolean impliesImplicitFlow()
true if this response type implies an implicit flow.
Implicit flow response_type values: token, id_token token, id_token
true if an implicit flow is implied, else
false.public boolean impliesHybridFlow()
true if this response type implies an OpenID Connect
hybrid flow.
Hybrid flow response_type values: code id_token, code token, code id_token token
true if a hybrid flow is implied, else
false.public boolean contains(String value)
value - The string value. Must not be null.true if the value is contained, else false.public String toString()
Example serialised response types:
code token id_token id_token token code token code id_token code id_token token
toString in class AbstractCollection<ResponseType.Value>Copyright © 2018 Connect2id Ltd.. All rights reserved.