public class AuthenticationResponseParser extends Object
Related specifications:
Modifier and Type | Method | Description |
---|---|---|
static AuthenticationResponse |
parse(HTTPRequest httpRequest) |
Parses an OpenID Connect authentication response from the specified
HTTP request at the client redirection (callback) URI.
|
static AuthenticationResponse |
parse(HTTPRequest httpRequest,
JARMValidator jarmValidator) |
Parses and validates a JSON Web Token (JWT) secured OpenID Connect
authentication response from the specified HTTP request at the
client redirection (callback) URI.
|
static AuthenticationResponse |
parse(HTTPResponse httpResponse) |
Parses an OpenID Connect authentication response from the specified
initial HTTP 302 redirect response output at the authorisation
endpoint.
|
static AuthenticationResponse |
parse(HTTPResponse httpResponse,
JARMValidator jarmValidator) |
Parses and validates a JSON Web Token (JWT) secured OpenID Connect
authentication response from the specified initial HTTP 302 redirect
response output at the authorisation endpoint.
|
static AuthenticationResponse |
parse(URI uri) |
Parses an OpenID Connect authentication response.
|
static AuthenticationResponse |
parse(URI uri,
JARMValidator jarmValidator) |
Parses and validates a JSON Web Token (JWT) secured OpenID Connect
authentication response.
|
static AuthenticationResponse |
parse(URI redirectURI,
Map<String,List<String>> params) |
Parses an OpenID Connect authentication response.
|
static AuthenticationResponse |
parse(URI redirectURI,
Map<String,List<String>> params,
JARMValidator jarmValidator) |
Parses an OpenID Connect authentication response which may be
JSON Web Token (JWT) secured.
|
public static AuthenticationResponse parse(URI redirectURI, Map<String,List<String>> params) throws ParseException
redirectURI
- The base redirection URI. Must not be
null
.params
- The response parameters to parse. Must not be
null
.ParseException
- If the parameters couldn't be parsed to an
OpenID Connect authentication response.public static AuthenticationResponse parse(URI redirectURI, Map<String,List<String>> params, JARMValidator jarmValidator) throws ParseException
redirectURI
- The base redirection URI. Must not be
null
.params
- The response parameters to parse. Must not be
null
.jarmValidator
- The validator of JSON Web Token (JWT) secured
authorisation responses (JARM), null
if
a plain response is expected.ParseException
- If the parameters couldn't be parsed to an
OpenID Connect authentication response, or if
validation of the JWT response failed.public static AuthenticationResponse parse(URI uri) throws ParseException
Use a relative URI if the host, port and path details are not known:
URI relUrl = new URI("https:///?code=Qcb0Orv1...&state=af0ifjsldkj");
Example URI:
https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA&state=xyz
uri
- The URI to parse. Can be absolute or relative, with a
fragment or query string containing the authentication
response parameters. Must not be null
.ParseException
- If the redirection URI couldn't be parsed to
an OpenID Connect authentication response.public static AuthenticationResponse parse(URI uri, JARMValidator jarmValidator) throws ParseException
Use a relative URI if the host, port and path details are not known:
URI relUrl = new URI("https:///?response=eyJhbGciOiJSUzI1NiIsI...");
uri
- The URI to parse. Can be absolute or relative,
with a fragment or query string containing the
authentication response parameters. Must not be
null
.jarmValidator
- The validator of JSON Web Token (JWT) secured
authorisation responses (JARM). Must not be
null
.ParseException
- If the redirection URI couldn't be parsed to
an OpenID Connect authentication response or
if validation of the JWT response failed.public static AuthenticationResponse parse(HTTPResponse httpResponse) throws ParseException
Example HTTP response (authorisation success):
HTTP/1.1 302 Found Location: https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA&state=xyz
httpResponse
- The HTTP response to parse. Must not be
null
.ParseException
- If the HTTP response couldn't be parsed to an
OpenID Connect authentication response.public static AuthenticationResponse parse(HTTPResponse httpResponse, JARMValidator jarmValidator) throws ParseException
Example HTTP response (authorisation success):
HTTP/1.1 302 Found Location: https://client.example.com/cb?response=eyJhbGciOiJSUzI1...
httpResponse
- The HTTP response to parse. Must not be
null
.jarmValidator
- The validator of JSON Web Token (JWT) secured
authorisation responses (JARM). Must not be
null
.ParseException
- If the HTTP response couldn't be parsed to an
OpenID Connect authentication response or if
validation of the JWT response failed.public static AuthenticationResponse parse(HTTPRequest httpRequest) throws ParseException
query
, fragment
and form_post
response
modes.
Example HTTP request (authorisation success):
GET /cb?code=SplxlOBeZQQYbYS6WxSbIA&state=xyz HTTP/1.1 Host: client.example.com
httpRequest
- The HTTP request to parse. Must not be
null
.ParseException
- If the HTTP request couldn't be parsed to an
OpenID Connect authentication response.parse(HTTPResponse)
public static AuthenticationResponse parse(HTTPRequest httpRequest, JARMValidator jarmValidator) throws ParseException
query.jwt
,
fragment.jwt
and form_post.jwt
response modes.
Example HTTP request (authorisation success):
GET /cb?response=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9... HTTP/1.1 Host: client.example.com
httpRequest
- The HTTP request to parse. Must not be
null
.jarmValidator
- The validator of JSON Web Token (JWT) secured
authorisation responses (JARM). Must not be
null
.ParseException
- If the HTTP request couldn't be parsed to an
OpenID Connect authentication response or if
validation of the JWT response failed.parse(HTTPResponse)
Copyright © 2019 Connect2id Ltd.. All rights reserved.