|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractSet<E> java.util.HashSet<ResponseType.Value> com.nimbusds.oauth2.sdk.ResponseType
@NotThreadSafe public class ResponseType
Authorisation response type. Can be single-valued or multiple-valued. This class is not thread-safe.
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:
Nested Class Summary | |
---|---|
static class |
ResponseType.Value
Authorisation response type value. |
Constructor Summary | |
---|---|
ResponseType()
Creates a new empty response type. |
Method Summary | |
---|---|
static ResponseType |
getDefault()
Gets the default response type. |
boolean |
impliesCodeFlow()
Returns true if this response type implies a code 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. |
Methods inherited from class java.util.HashSet |
---|
add, clear, clone, contains, isEmpty, iterator, remove, size |
Methods inherited from class java.util.AbstractSet |
---|
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, containsAll, retainAll, toArray, toArray |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
---|
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
Constructor Detail |
---|
public ResponseType()
Method Detail |
---|
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 a code flow. This
is determined by the presence of a code
value.
true
if a code flow is implied, else false
.public boolean impliesImplicitFlow()
true
if this response type implies an implicit flow.
This is determined by the absence of a code
value.
true
if an implicit flow is implied, 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>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |