Package com.nimbusds.openid.connect.sdk
Class LogoutRequest
java.lang.Object
com.nimbusds.oauth2.sdk.AbstractRequest
com.nimbusds.openid.connect.sdk.LogoutRequest
Logout request initiated by an OpenID relying party (RP).
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:
- OpenID Connect RP-Initiated Logout 1.0 (draft 2), section 2.
-
Constructor Summary
ConstructorsConstructorDescriptionLogoutRequest(URI uri) Creates a new OpenID Connect logout request without a post-logout redirection.LogoutRequest(URI uri, com.nimbusds.jwt.JWT idTokenHint) Creates a new OpenID Connect logout request without a post-logout redirection.LogoutRequest(URI uri, com.nimbusds.jwt.JWT idTokenHint, String logoutHint, ClientID clientID, URI postLogoutRedirectURI, State state, List<com.nimbusds.langtag.LangTag> uiLocales) Creates a new OpenID Connect logout request.LogoutRequest(URI uri, com.nimbusds.jwt.JWT idTokenHint, URI postLogoutRedirectURI, State state) Creates a new OpenID Connect logout request. -
Method Summary
Modifier and TypeMethodDescriptionReturns the client ID.com.nimbusds.jwt.JWTReturns the ID token hint.Returns the logout hint.Return the post-logout redirection URI.getState()Returns the state parameter for a post-logout redirection URI.List<com.nimbusds.langtag.LangTag>Returns the end-user's preferred languages and scripts for the user interface, ordered by preference.static LogoutRequestparse(HTTPRequest httpRequest) Parses a logout request from the specified HTTP request.static LogoutRequestParses a logout request from the specified URI query string.static LogoutRequestParses a logout request from the specified URI.static LogoutRequestParses a logout request from the specified URI query string.static LogoutRequestParses a logout request from the specified URI and query parameters.static LogoutRequestParses a logout request from the specified URI query parameters.Returns the matching HTTP request.Returns the URI query parameters for this logout request.Returns the URI query string for this logout request.toURI()Returns the complete URI representation for this logout request, consisting of theend-session endpoint URIwith thequery stringappended.Methods inherited from class com.nimbusds.oauth2.sdk.AbstractRequest
getEndpointURI
-
Constructor Details
-
LogoutRequest
public LogoutRequest(URI uri, com.nimbusds.jwt.JWT idTokenHint, String logoutHint, ClientID clientID, URI postLogoutRedirectURI, State state, List<com.nimbusds.langtag.LangTag> uiLocales) Creates a new OpenID Connect logout request.- Parameters:
uri- The URI of the end-session endpoint. May benullif thetoHTTPRequest()method will not be used.idTokenHint- The ID token hint (recommended),nullif not specified.logoutHint- The optional logout hint,nullif not specified.clientID- The optional client ID,nullif not specified.postLogoutRedirectURI- The optional post-logout redirection URI,nullif not specified.state- The optional state parameter for the post-logout redirection URI,nullif not specified.uiLocales- The optional end-user's preferred languages and scripts for the user interface, ordered by preference.
-
LogoutRequest
public LogoutRequest(URI uri, com.nimbusds.jwt.JWT idTokenHint, URI postLogoutRedirectURI, State state) Creates a new OpenID Connect logout request.- Parameters:
uri- The URI of the end-session endpoint. May benullif thetoHTTPRequest()method will not be used.idTokenHint- The ID token hint (recommended),nullif not specified.postLogoutRedirectURI- The optional post-logout redirection URI,nullif not specified.state- The optional state parameter for the post-logout redirection URI,nullif not specified.
-
LogoutRequest
Creates a new OpenID Connect logout request without a post-logout redirection.- Parameters:
uri- The URI of the end-session endpoint. May benullif thetoHTTPRequest()method will not be used.idTokenHint- The ID token hint (recommended),nullif not specified.
-
LogoutRequest
Creates a new OpenID Connect logout request without a post-logout redirection.- Parameters:
uri- The URI of the end-session endpoint. May benullif thetoHTTPRequest()method will not be used.
-
-
Method Details
-
getIDTokenHint
Returns the ID token hint. Corresponds to the optionalid_token_hintparameter.- Returns:
- The ID token hint,
nullif not specified.
-
getLogoutHint
Returns the logout hint. Corresponds to the optionallogout_hintparameter.- Returns:
- The logout hint,
nullif not specified.
-
getClientID
Returns the client ID. Corresponds to the optionalclient_idparameter.- Returns:
- The client ID,
nullif not specified.
-
getPostLogoutRedirectionURI
Return the post-logout redirection URI.- Returns:
- The post-logout redirection URI,
nullif not specified.
-
getState
Returns the state parameter for a post-logout redirection URI. Corresponds to the optionalstateparameter.- Returns:
- The state parameter,
nullif not specified.
-
getUILocales
Returns the end-user's preferred languages and scripts for the user interface, ordered by preference. Corresponds to the optionalui_localesparameter.- Returns:
- The preferred UI locales,
nullif not specified.
-
toParameters
Returns the URI query parameters for this logout request.Example parameters:
id_token_hint = eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... post_logout_redirect_uri = https://client.example.com/post-logout state = af0ifjsldkj
- Returns:
- The parameters.
-
toQueryString
Returns the URI query string for this logout request.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
- Returns:
- The URI query string.
-
toURI
Returns the complete URI representation for this logout request, consisting of theend-session endpoint URIwith thequery stringappended.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
- Returns:
- The URI representation.
-
toHTTPRequest
Description copied from interface:RequestReturns the matching HTTP request.- Returns:
- The HTTP request.
-
parse
Parses a logout request from the specified URI query parameters.Example parameters:
id_token_hint = eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... post_logout_redirect_uri = https://client.example.com/post-logout state = af0ifjsldkj
- Parameters:
params- The parameters, empty map if none. Must not benull.- Returns:
- The logout request.
- Throws:
ParseException- If the parameters couldn't be parsed to a logout request.
-
parse
Parses a logout request from the specified URI and query parameters.Example parameters:
id_token_hint = eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... post_logout_redirect_uri = https://client.example.com/post-logout state = af0ifjsldkj
- Parameters:
uri- The URI of the end-session endpoint. May benullif thetoHTTPRequest()method will not be used.params- The parameters, empty map if none. Must not benull.- Returns:
- The logout request.
- Throws:
ParseException- If the parameters couldn't be parsed to a logout request.
-
parse
Parses a logout request from the specified URI query string.Example URI query string:
id_token_hint = eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... &post_logout_redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fpost-logout &state=af0ifjsldkj
- Parameters:
query- The URI query string,nullif none.- Returns:
- The logout request.
- Throws:
ParseException- If the query string couldn't be parsed to a logout request.
-
parse
Parses a logout request from the specified URI query string.Example URI query string:
id_token_hint = eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi... &post_logout_redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fpost-logout &state=af0ifjsldkj
- Parameters:
uri- The URI of the end-session endpoint. May benullif thetoHTTPRequest()method will not be used.query- The URI query string,nullif none.- Returns:
- The logout request.
- Throws:
ParseException- If the query string couldn't be parsed to a logout request.
-
parse
Parses a logout request from the specified URI.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
- Parameters:
uri- The URI. Must not benull.- Returns:
- The logout request.
- Throws:
ParseException- If the URI couldn't be parsed to a logout request.
-
parse
Parses a logout request from the specified HTTP request.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
- Parameters:
httpRequest- The HTTP request. Must not benull.- Returns:
- The logout request.
- Throws:
ParseException- If the HTTP request couldn't be parsed to a logout request.
-