Package com.nimbusds.oauth2.sdk.ciba
Class CIBATokenDelivery
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.AbstractRequest
-
- com.nimbusds.oauth2.sdk.ProtectedResourceRequest
-
- com.nimbusds.oauth2.sdk.ciba.CIBAPushCallback
-
- com.nimbusds.oauth2.sdk.ciba.CIBATokenDelivery
-
@Immutable public class CIBATokenDelivery extends CIBAPushCallback
CIBA token push delivery to the client notification endpoint.Example HTTP request:
POST /cb HTTP/1.1 Host: client.example.com Authorization: Bearer 8d67dc78-7faa-4d41-aabd-67707b374255 Content-Type: application/json { "auth_req_id": "1c266114-a1be-4252-8ad1-04986c5b9ac1", "access_token": "G5kXH2wHvUra0sHlDy1iTkDJgsgUO1bN", "token_type": "Bearer", "refresh_token": "4bwc0ESC_IAhflf-ACC_vjD_ltc11ne-8gFPfA2Kx16", "expires_in": 120, "id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjE2NzcyNiJ9.eyJpc3MiOiJ odHRwczovL3NlcnZlci5leGFtcGxlLmNvbSIsInN1YiI6IjI0ODI4OTc2MTAwMS IsImF1ZCI6InM2QmhkUmtxdDMiLCJlbWFpbCI6ImphbmVkb2VAZXhhbXBsZS5jb 20iLCJleHAiOjE1Mzc4MTk4MDMsImlhdCI6MTUzNzgxOTUwMywiYXRfaGFzaCI6 Ild0MGtWRlhNYWNxdm5IZXlVMDAwMXciLCJ1cm46b3BlbmlkOnBhcmFtczpqd3Q 6Y2xhaW06cnRfaGFzaCI6InNIYWhDdVNwWENSZzVta0REdnZyNHciLCJ1cm46b3 BlbmlkOnBhcmFtczpqd3Q6Y2xhaW06YXV0aF9yZXFfaWQiOiIxYzI2NjExNC1hM WJlLTQyNTItOGFkMS0wNDk4NmM1YjlhYzEifQ.SGB5_a8E7GjwtoYrkFyqOhLK6 L8-Wh1nLeREwWj30gNYOZW_ZB2mOeQ5yiXqeKJeNpDPssGUrNo-3N-CqNrbmVCb XYTwmNB7IvwE6ZPRcfxFV22oou-NS4-3rEa2ghG44Fi9D9fVURwxrRqgyezeD3H HVIFUnCxHUou3OOpj6aOgDqKI4Xl2xJ0-kKAxNR8LljUp64OHgoS-UO3qyfOwIk IAR7o4OTK_3Oy78rJNT0Y0RebAWyA81UDCSf_gWVBp-EUTI5CdZ1_odYhwB9OWD W1A22Sf6rmjhMHGbQW4A9Z822yiZZveuT_AFZ2hi7yNp8iFPZ8fgPQJ5pPpjA7u dg" }
Related specifications:
- OpenID Connect CIBA Flow - Core 1.0, section 10.3.1.
-
-
Constructor Summary
Constructors Constructor Description CIBATokenDelivery(URI endpoint, BearerAccessToken accessToken, AuthRequestID authRequestID, Tokens tokens)
Creates a new CIBA push token delivery for OAuth 2.0.CIBATokenDelivery(URI endpoint, BearerAccessToken accessToken, AuthRequestID authRequestID, OIDCTokens oidcTokens)
Creates a new CIBA push token delivery for OpenID Connect.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OIDCTokens
getOIDCTokens()
Returns the OpenID Connect tokens if present.Tokens
getTokens()
Returns the OAuth 2.0 tokens.boolean
indicatesSuccess()
Checks if the callback indicates success.static CIBATokenDelivery
parse(HTTPRequest httpRequest)
Parses a CIBA push token delivery from the specified HTTP request.HTTPRequest
toHTTPRequest()
Returns the matching HTTP request.-
Methods inherited from class com.nimbusds.oauth2.sdk.ciba.CIBAPushCallback
getAuthRequestID, toErrorDelivery, toTokenDelivery
-
Methods inherited from class com.nimbusds.oauth2.sdk.ProtectedResourceRequest
getAccessToken
-
Methods inherited from class com.nimbusds.oauth2.sdk.AbstractRequest
getEndpointURI
-
-
-
-
Constructor Detail
-
CIBATokenDelivery
public CIBATokenDelivery(URI endpoint, BearerAccessToken accessToken, AuthRequestID authRequestID, Tokens tokens)
Creates a new CIBA push token delivery for OAuth 2.0.- Parameters:
endpoint
- The client notification endpoint. Must not benull
.accessToken
- The client notification token. Must not benull
.authRequestID
- The CIBA request ID. Must not benull
.tokens
- The OAuth 2.0 tokens to deliver. Must not benull
.
-
CIBATokenDelivery
public CIBATokenDelivery(URI endpoint, BearerAccessToken accessToken, AuthRequestID authRequestID, OIDCTokens oidcTokens)
Creates a new CIBA push token delivery for OpenID Connect.- Parameters:
endpoint
- The client notification endpoint. Must not benull
.accessToken
- The client notification token. Must not benull
.authRequestID
- The CIBA request ID. Must not benull
.oidcTokens
- The OpenID Connect tokens to deliver. Must not benull
.
-
-
Method Detail
-
indicatesSuccess
public boolean indicatesSuccess()
Description copied from class:CIBAPushCallback
Checks if the callback indicates success.- Specified by:
indicatesSuccess
in classCIBAPushCallback
- Returns:
true
if the callback indicates success, elsefalse
.
-
getOIDCTokens
public OIDCTokens getOIDCTokens()
Returns the OpenID Connect tokens if present.- Returns:
- The OpenID Connect tokens,
null
if none.
-
toHTTPRequest
public HTTPRequest toHTTPRequest()
Description copied from interface:Request
Returns the matching HTTP request.- Returns:
- The HTTP request.
-
parse
public static CIBATokenDelivery parse(HTTPRequest httpRequest) throws ParseException
Parses a CIBA push token delivery from the specified HTTP request.- Parameters:
httpRequest
- The HTTP request. Must not benull
.- Returns:
- The CIBA push token delivery.
- Throws:
ParseException
- If parsing failed.
-
-