@Immutable public class LogoutRequest extends AbstractRequest
Example HTTP request:
https://server.example.com/op/logout? id_token_hint=eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... &post_logout_redirect_uri=https%3A%2F%2Fclient.example.org%2Fpost-logout &state=af0ifjsldkj
Related specifications:
Constructor and Description |
---|
LogoutRequest(java.net.URI uri,
com.nimbusds.jwt.JWT idTokenHint)
Creates a new OpenID Connect logout request with a post-logout
redirection.
|
LogoutRequest(java.net.URI uri,
com.nimbusds.jwt.JWT idTokenHint,
java.net.URI postLogoutRedirectURI,
State state)
Creates a new OpenID Connect logout request.
|
Modifier and Type | Method and Description |
---|---|
com.nimbusds.jwt.JWT |
getIDTokenHint()
Returns the ID token hint.
|
java.net.URI |
getPostLogoutRedirectionURI()
Return the post-logout redirection URI.
|
State |
getState()
Returns the state parameter for a post-logout redirection URI.
|
static LogoutRequest |
parse(HTTPRequest httpRequest)
Parses a logout request from the specified HTTP request.
|
static LogoutRequest |
parse(java.util.Map<java.lang.String,java.lang.String> params)
Parses a logout request from the specified parameters.
|
static LogoutRequest |
parse(java.lang.String query)
Parses a logout request from the specified URI query string.
|
static LogoutRequest |
parse(java.net.URI uri)
Parses a logout request from the specified URI.
|
static LogoutRequest |
parse(java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> params)
Parses a logout request from the specified parameters.
|
static LogoutRequest |
parse(java.net.URI uri,
java.lang.String query)
Parses a logout request from the specified URI query string.
|
HTTPRequest |
toHTTPRequest()
Returns the matching HTTP request.
|
java.util.Map<java.lang.String,java.lang.String> |
toParameters()
Returns the parameters for this authorisation request.
|
java.lang.String |
toQueryString()
Returns the URI query string for this logout request.
|
java.net.URI |
toURI()
Returns the complete URI representation for this logout request,
consisting of the
end-session endpoint URI
with the query string appended. |
getEndpointURI
public LogoutRequest(java.net.URI uri, com.nimbusds.jwt.JWT idTokenHint, java.net.URI postLogoutRedirectURI, State state)
uri
- The URI of the end-session endpoint.
May be null
if the
toHTTPRequest()
method will not
be used.idTokenHint
- The ID token hint. Must not be
null
.postLogoutRedirectURI
- The optional post-logout redirection
URI, null
if not specified.state
- The optional state parameter for a
post-logout redirection URI,
null
if not specified.public LogoutRequest(java.net.URI uri, com.nimbusds.jwt.JWT idTokenHint)
uri
- The URI of the end-session endpoint. May be
null
if the toHTTPRequest()
method
will not be used.idTokenHint
- The ID token hint. Must not be null
.public com.nimbusds.jwt.JWT getIDTokenHint()
public java.net.URI getPostLogoutRedirectionURI()
null
if not
specified.public State getState()
null
if not specified.public java.util.Map<java.lang.String,java.lang.String> toParameters()
Example parameters:
id_token_hint = eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... post_logout_redirect_uri = https://client.example.com/post-logout state = af0ifjsldkj
public java.lang.String toQueryString()
Note that the '?' character preceding the query string in an URI is not included in the returned string.
Example URI query string:
id_token_hint = eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... &post_logout_redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fpost-logout &state=af0ifjsldkj
public java.net.URI toURI()
end-session endpoint URI
with the query string
appended.
Example URI:
https://server.example.com/logout? id_token_hint = eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... &post_logout_redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fpost-logout &state=af0ifjsldkj
public HTTPRequest toHTTPRequest()
Request
public static LogoutRequest parse(java.util.Map<java.lang.String,java.lang.String> params) throws ParseException
Example parameters:
id_token_hint = eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... post_logout_redirect_uri = https://client.example.com/post-logout state = af0ifjsldkj
params
- The parameters. Must not be null
.ParseException
- If the parameters couldn't be parsed to a
logout request.public static LogoutRequest parse(java.net.URI uri, java.util.Map<java.lang.String,java.lang.String> params) throws ParseException
Example parameters:
id_token_hint = eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... post_logout_redirect_uri = https://client.example.com/post-logout state = af0ifjsldkj
uri
- The URI of the end-session endpoint. May be
null
if the toHTTPRequest()
method
will not be used.params
- The parameters. Must not be null
.ParseException
- If the parameters couldn't be parsed to a
logout request.public static LogoutRequest parse(java.lang.String query) throws ParseException
Example URI query string:
id_token_hint = eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... &post_logout_redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fpost-logout &state=af0ifjsldkj
query
- The URI query string. Must not be null
.ParseException
- If the query string couldn't be parsed to a
logout request.public static LogoutRequest parse(java.net.URI uri, java.lang.String query) throws ParseException
Example URI query string:
id_token_hint = eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... &post_logout_redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fpost-logout &state=af0ifjsldkj
uri
- The URI of the end-session endpoint. May be
null
if the toHTTPRequest()
method
will not be used.query
- The URI query string. Must not be null
.ParseException
- If the query string couldn't be parsed to a
logout request.public static LogoutRequest parse(java.net.URI uri) throws ParseException
Example URI:
https://server.example.com/logout? id_token_hint = eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... &post_logout_redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fpost-logout &state=af0ifjsldkj
uri
- The URI. Must not be null
.ParseException
- If the URI couldn't be parsed to a logout
request.public static LogoutRequest parse(HTTPRequest httpRequest) throws ParseException
Example HTTP request (GET):
https://server.example.com/logout? id_token_hint = eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... &post_logout_redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fpost-logout &state=af0ifjsldkj
httpRequest
- The HTTP request. Must not be null
.ParseException
- If the HTTP request couldn't be parsed to a
logout request.Copyright © 2015 Connect2id Ltd.. All Rights Reserved.