@Immutable public class AuthenticationSuccessResponse extends AuthorizationSuccessResponse implements AuthenticationResponse
Example HTTP response with code and ID Token (code flow):
HTTP/1.1 302 Found Location: https://client.example.org/cb# code=Qcb0Orv1zh30vL1MPRsbm-diHiMwcLyZvn1arpZv-Jxf_11jnpEX3Tgfvk &id_token=eyJhbGciOiJSUzI1NiJ9.ew0KICAgICJpc3MiOiAiaHR0cDovL3Nlc nZlci5leGFtcGxlLmNvbSIsDQogICAgInVzZXJfaWQiOiAiMjQ4Mjg5NzYxMDAxI iwNCiAgICAiYXVkIjogInM2QmhkUmtxdDMiLA0KICAgICJub25jZSI6ICJuLTBTN l9XekEyTWoiLA0KICAgICJleHAiOiAxMzExMjgxOTcwLA0KICAgICJpYXQiOiAxM zExMjgwOTcwLA0KICAgICJjX2hhc2giOiAiTERrdEtkb1FhazNQazBjblh4Q2x0Q mdfckNfM1RLVWI5T0xrNWZLTzl1QSINCn0.D6JxCgpOwlyuK7DPRu5hFOIJRSRDT B7TQNRbOw9Vg9WroDi_XNzaqXCFSDH_YqcE-CBhoxD-Iq4eQL4E2jIjil47u7i68 Nheev7d8AJk4wfRimgpDhQX5K8YyGDWrTs7bhsMTPAPVa9bLIBndDZ2mEdmPcmR9 mXcwJI3IGF9JOaStYXJXMYWUMCmQARZEKG9JxIYPZNhFsqKe4TYQEmrq2s_HHQwk XCGAmLBdptHY-Zx277qtidojQQFXzbD2Ak1ONT5sFjy3yxPnE87pNVtOEST5GJac O1O88gmvmjNayu1-f5mr5Uc70QC6DjlKem3cUN5kudAQ4sLvFkUr8gkIQ
Related specifications:
Constructor and Description |
---|
AuthenticationSuccessResponse(URI redirectURI,
AuthorizationCode code,
com.nimbusds.jwt.JWT idToken,
AccessToken accessToken,
State state)
Creates a new OpenID Connect authentication success response.
|
Modifier and Type | Method and Description |
---|---|
com.nimbusds.jwt.JWT |
getIDToken()
Gets the requested ID token.
|
ResponseType |
impliedResponseType()
Returns the implied response type.
|
static AuthenticationSuccessResponse |
parse(HTTPResponse httpResponse)
Parses an OpenID Connect authentication success response from the
specified HTTP response.
|
static AuthenticationSuccessResponse |
parse(URI uri)
Parses an OpenID Connect authentication success response from the
specified URI.
|
static AuthenticationSuccessResponse |
parse(URI redirectURI,
Map<String,String> params)
Parses an OpenID Connect authentication success response from the
specified redirection URI and parameters.
|
Map<String,String> |
toParameters()
Returns the parameters of this authorisation response.
|
URI |
toURI()
Returns the URI representation (redirection URI + fragment / query
string) of this authorisation response.
|
getAccessToken, getAuthorizationCode
getRedirectionURI, getState, toHTTPResponse
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toHTTPResponse
public AuthenticationSuccessResponse(URI redirectURI, AuthorizationCode code, com.nimbusds.jwt.JWT idToken, AccessToken accessToken, State state)
redirectURI
- The requested redirection URI. Must not be
null
.code
- The authorisation code, null
if not
requested.idToken
- The ID token (ready for output), null
if
not requested.accessToken
- The UserInfo access token, null
if not
requested.state
- The state, null
if not requested.public ResponseType impliedResponseType()
AuthorizationSuccessResponse
impliedResponseType
in class AuthorizationSuccessResponse
public com.nimbusds.jwt.JWT getIDToken()
null
if not
requested.public Map<String,String> toParameters() throws SerializeException
AuthorizationResponse
Example parameters (authorisation success):
access_token = 2YotnFZFEjr1zCsicMWpAA state = xyz token_type = example expires_in = 3600
toParameters
in class AuthorizationSuccessResponse
SerializeException
- If this response couldn't be serialised
to a parameters map.public URI toURI() throws SerializeException
AuthorizationResponse
Example URI:
http://example.com/cb#access_token=2YotnFZFEjr1zCsicMWpAA &state=xyz &token_type=example &expires_in=3600
toURI
in class AuthorizationSuccessResponse
SerializeException
- If this response couldn't be serialised
to a URI.public static AuthenticationSuccessResponse parse(URI redirectURI, Map<String,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 success
response.public static AuthenticationSuccessResponse parse(URI uri) throws ParseException
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 success
response.public static AuthenticationSuccessResponse parse(HTTPResponse httpResponse) throws ParseException
Example HTTP response:
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 success
response.Copyright © 2014 NimbusDS. All Rights Reserved.