|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nimbusds.oauth2.sdk.AuthorizationResponse com.nimbusds.oauth2.sdk.AuthorizationSuccessResponse com.nimbusds.openid.connect.sdk.OIDCAuthorizationSuccessResponse
@Immutable public class OIDCAuthorizationSuccessResponse
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:
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. |
ResponseTypeSet |
getImpliedResponseTypeSet()
Gets the implied response type set. |
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 |
---|
public OIDCAuthorizationSuccessResponse(URL redirectURI, AuthorizationCode code, com.nimbusds.jwt.JWT idToken, AccessToken accessToken, State state)
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 |
---|
public ResponseTypeSet getImpliedResponseTypeSet()
AuthorizationSuccessResponse
getImpliedResponseTypeSet
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 static OIDCAuthorizationSuccessResponse parse(URL redirectURI, Map<String,String> params) throws ParseException
redirectURI
- The base redirect 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 authorisation success
response.public static OIDCAuthorizationSuccessResponse parse(URL 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 authorisation
response parameters. Must not be null
.
ParseException
- If the redirect URI couldn't be parsed to an
OpenID Connect authorisation success
response.public static OIDCAuthorizationSuccessResponse 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 authorisation success
response.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |