com.nimbusds.openid.connect.sdk
Class OIDCAuthorizationSuccessResponse

java.lang.Object
  extended by com.nimbusds.oauth2.sdk.AuthorizationResponse
      extended by com.nimbusds.oauth2.sdk.AuthorizationSuccessResponse
          extended by com.nimbusds.openid.connect.sdk.OIDCAuthorizationSuccessResponse
All Implemented Interfaces:
Message, Response, SuccessResponse, OIDCAuthorizationResponse

@Immutable
public class OIDCAuthorizationSuccessResponse
extends AuthorizationSuccessResponse
implements OIDCAuthorizationResponse

OpenID Connect authorisation success response. Used to return an authorization code, access token and / or ID Token at the Authorisation endpoint. This class is immutable.

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:

Author:
Vladimir Dzhuvinov

Constructor Summary
OIDCAuthorizationSuccessResponse(URL redirectURI, AuthorizationCode code, com.nimbusds.jwt.JWT idToken, AccessToken accessToken, State state)
          Creates a new OpenID Connect authorisation success response.
 
Method Summary
 com.nimbusds.jwt.JWT getIDToken()
          Gets the requested ID token.
 ResponseType getImpliedResponseType()
          Gets the implied response type.
static OIDCAuthorizationSuccessResponse parse(HTTPResponse httpResponse)
          Parses an OpenID Connect authorisation success response from the specified HTTP response.
static OIDCAuthorizationSuccessResponse parse(URL uri)
          Parses an OpenID Connect authorisation success response from the specified URI.
static OIDCAuthorizationSuccessResponse parse(URL redirectURI, Map<String,String> params)
          Parses an OpenID Connect authorisation success response from the specified redirect URI and parameters.
 Map<String,String> toParameters()
          Returns the parameters of this authorisation response.
 
Methods inherited from class com.nimbusds.oauth2.sdk.AuthorizationSuccessResponse
getAccessToken, getAuthorizationCode, toURI
 
Methods inherited from class com.nimbusds.oauth2.sdk.AuthorizationResponse
getRedirectURI, getState, toHTTPResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.nimbusds.oauth2.sdk.Response
toHTTPResponse
 

Constructor Detail

OIDCAuthorizationSuccessResponse

public OIDCAuthorizationSuccessResponse(URL redirectURI,
                                        AuthorizationCode code,
                                        com.nimbusds.jwt.JWT idToken,
                                        AccessToken accessToken,
                                        State state)
Creates a new OpenID Connect authorisation success response.

Parameters:
redirectURI - The requested redirect 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.
Method Detail

getImpliedResponseType

public ResponseType getImpliedResponseType()
Description copied from class: AuthorizationSuccessResponse
Gets the implied response type.

Overrides:
getImpliedResponseType in class AuthorizationSuccessResponse
Returns:
The implied response type.

getIDToken

public com.nimbusds.jwt.JWT getIDToken()
Gets the requested ID token.

Returns:
The ID token (ready for output), null if not requested.

toParameters

public Map<String,String> toParameters()
                                throws SerializeException
Description copied from class: AuthorizationResponse
Returns the parameters of this authorisation response.

Example parameters (authorisation success):

 access_token = 2YotnFZFEjr1zCsicMWpAA
 state = xyz
 token_type = example
 expires_in = 3600
 

Overrides:
toParameters in class AuthorizationSuccessResponse
Returns:
The parameters as a map.
Throws:
SerializeException - If this response couldn't be serialised to a parameters map.

parse

public static OIDCAuthorizationSuccessResponse parse(URL redirectURI,
                                                     Map<String,String> params)
                                              throws ParseException
Parses an OpenID Connect authorisation success response from the specified redirect URI and parameters.

Parameters:
redirectURI - The base redirect URI. Must not be null.
params - The response parameters to parse. Must not be null.
Returns:
The OpenID Connect authorisation success response.
Throws:
ParseException - If the parameters couldn't be parsed to an OpenID Connect authorisation success response.

parse

public static OIDCAuthorizationSuccessResponse parse(URL uri)
                                              throws ParseException
Parses an OpenID Connect authorisation success response from the specified URI.

Example URI:

 https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA&state=xyz
 

Parameters:
uri - The URI to parse. Can be absolute or relative, with a fragment or query string containing the authorisation response parameters. Must not be null.
Returns:
The OpenID Connect authorisation success response.
Throws:
ParseException - If the redirect URI couldn't be parsed to an OpenID Connect authorisation success response.

parse

public static OIDCAuthorizationSuccessResponse parse(HTTPResponse httpResponse)
                                              throws ParseException
Parses an OpenID Connect authorisation success response from the specified HTTP response.

Example HTTP response:

 HTTP/1.1 302 Found
 Location: https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA&state=xyz
 

Parameters:
httpResponse - The HTTP response to parse. Must not be null.
Returns:
The OpenID Connect authorisation success response.
Throws:
ParseException - If the HTTP response couldn't be parsed to an OpenID Connect authorisation success response.


Copyright © 2013 NimbusDS. All Rights Reserved.