Package com.nimbusds.oauth2.sdk.ciba
Class CIBARequestAcknowledgement
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.ciba.CIBAResponse
-
- com.nimbusds.oauth2.sdk.ciba.CIBARequestAcknowledgement
-
- All Implemented Interfaces:
Message
,Response
,SuccessResponse
@Immutable public class CIBARequestAcknowledgement extends CIBAResponse implements SuccessResponse
Successful CIBA request acknowledgement from an OpenID provider / OAuth 2.0 authorisation server backend authentication endpoint.Example HTTP response:
HTTP/1.1 200 OK Content-Type: application/json Cache-Control: no-store { "auth_req_id": "1c266114-a1be-4252-8ad1-04986c5b9ac1", "expires_in": 120, "interval": 2 }
Related specifications:
- OpenID Connect CIBA Flow - Core 1.0, section 7.3.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MIN_WAIT_INTERVAL
The default minimal wait interval in seconds for polling the token endpoint for the poll and ping delivery modes.
-
Constructor Summary
Constructors Constructor Description CIBARequestAcknowledgement(AuthRequestID authRequestID, int expiresIn, Integer minWaitInterval)
Creates a new successful CIBA request acknowledgement.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthRequestID
getAuthRequestID()
Returns the CIBA request ID.int
getExpiresIn()
Returns the expiration time of the CIBA request ID in seconds.Integer
getMinWaitInterval()
Returns the minimum wait interval in seconds for polling the token endpoint for the poll and ping delivery modes.boolean
indicatesSuccess()
Checks if the response indicates success.static CIBARequestAcknowledgement
parse(HTTPResponse httpResponse)
Parses a successful CIBA request acknowledgement from the specified HTTP response.static CIBARequestAcknowledgement
parse(net.minidev.json.JSONObject jsonObject)
Parses a successful CIBA request acknowledgement from the specified JSON object.HTTPResponse
toHTTPResponse()
Returns the matching HTTP response.net.minidev.json.JSONObject
toJSONObject()
Returns a JSON object representation of this CIBA request acknowledgement.-
Methods inherited from class com.nimbusds.oauth2.sdk.ciba.CIBAResponse
toErrorResponse, toRequestAcknowledgement
-
-
-
-
Field Detail
-
DEFAULT_MIN_WAIT_INTERVAL
public static final int DEFAULT_MIN_WAIT_INTERVAL
The default minimal wait interval in seconds for polling the token endpoint for the poll and ping delivery modes.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CIBARequestAcknowledgement
public CIBARequestAcknowledgement(AuthRequestID authRequestID, int expiresIn, Integer minWaitInterval)
Creates a new successful CIBA request acknowledgement.- Parameters:
authRequestID
- The CIBA request ID.expiresIn
- The expiration time of the CIBA request ID, in seconds. Must be positive.minWaitInterval
- The minimal wait interval in seconds for polling the token endpoint for the poll or ping delivery modes,null
if not specified.
-
-
Method Detail
-
indicatesSuccess
public boolean indicatesSuccess()
Description copied from interface:Response
Checks if the response indicates success.- Specified by:
indicatesSuccess
in interfaceResponse
- Returns:
true
if the response indicates success, elsefalse
.
-
getAuthRequestID
public AuthRequestID getAuthRequestID()
Returns the CIBA request ID.- Returns:
- The CIBA request ID.
-
getExpiresIn
public int getExpiresIn()
Returns the expiration time of the CIBA request ID in seconds.- Returns:
- The expiration time in seconds.
-
getMinWaitInterval
public Integer getMinWaitInterval()
Returns the minimum wait interval in seconds for polling the token endpoint for the poll and ping delivery modes.- Returns:
- The interval in seconds,
null
if not specified.
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject()
Returns a JSON object representation of this CIBA request acknowledgement.- Returns:
- The JSON object.
-
toHTTPResponse
public HTTPResponse toHTTPResponse()
Description copied from interface:Response
Returns the matching HTTP response.- Specified by:
toHTTPResponse
in interfaceResponse
- Returns:
- The HTTP response.
-
parse
public static CIBARequestAcknowledgement parse(net.minidev.json.JSONObject jsonObject) throws ParseException
Parses a successful CIBA request acknowledgement from the specified JSON object.- Parameters:
jsonObject
- The JSON object to parse. Must not benull
.- Returns:
- The CIBA request acknowledgement.
- Throws:
ParseException
- If parsing failed.
-
parse
public static CIBARequestAcknowledgement parse(HTTPResponse httpResponse) throws ParseException
Parses a successful CIBA request acknowledgement from the specified HTTP response.- Parameters:
httpResponse
- The HTTP response to parse. Must not benull
.- Returns:
- The CIBA request acknowledgement.
- Throws:
ParseException
- If parsing failed.
-
-