Package com.nimbusds.oauth2.sdk
Class PushedAuthorizationSuccessResponse
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.PushedAuthorizationResponse
-
- com.nimbusds.oauth2.sdk.PushedAuthorizationSuccessResponse
-
@Immutable public class PushedAuthorizationSuccessResponse extends PushedAuthorizationResponse
Pushed authorisation success response.Example HTTP response:
HTTP/1.1 201 Created Date: Tue, 2 May 2017 15:22:31 GMT Content-Type: application/json { "request_uri" : "urn:example:bwc4JK-ESC0w8acc191e-Y1LTC2", "expires_in" : 3600 }
Related specifications:
- OAuth 2.0 Pushed Authorization Requests (draft-lodderstedt-oauth-par-01)
-
-
Constructor Summary
Constructors Constructor Description PushedAuthorizationSuccessResponse(URI requestURI, long lifetime)
Creates a new pushed authorisation success response.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getLifetime()
Returns the request lifetime.URI
getRequestURI()
Returns the request URI.boolean
indicatesSuccess()
Checks if the response indicates success.static PushedAuthorizationSuccessResponse
parse(HTTPResponse httpResponse)
Parses a pushed authorisation success response from the specified HTTP response.static PushedAuthorizationSuccessResponse
parse(net.minidev.json.JSONObject jsonObject)
Parses pushed authorisation success response from the specified JSON object.HTTPResponse
toHTTPResponse()
Returns the matching HTTP response.net.minidev.json.JSONObject
toJSONObject()
Returns a JSON object representation of this pushed authorisation success response.-
Methods inherited from class com.nimbusds.oauth2.sdk.PushedAuthorizationResponse
toErrorResponse, toSuccessResponse
-
-
-
-
Constructor Detail
-
PushedAuthorizationSuccessResponse
public PushedAuthorizationSuccessResponse(URI requestURI, long lifetime)
Creates a new pushed authorisation success response.- Parameters:
requestURI
- The request URI. Must not benull
.lifetime
- The request lifetime, in seconds. Must be a positive integer.
-
-
Method Detail
-
getRequestURI
public URI getRequestURI()
Returns the request URI.- Returns:
- The request URI.
-
getLifetime
public long getLifetime()
Returns the request lifetime.- Returns:
- The request lifetime, in seconds.
-
indicatesSuccess
public boolean indicatesSuccess()
Description copied from interface:Response
Checks if the response indicates success.- Returns:
true
if the response indicates success, elsefalse
.
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject()
Returns a JSON object representation of this pushed authorisation success response.Example JSON object:
{ "request_uri": "urn:example:bwc4JK-ESC0w8acc191e-Y1LTC2", "expires_in": 3600 }
- Returns:
- The JSON object.
-
toHTTPResponse
public HTTPResponse toHTTPResponse()
Description copied from interface:Response
Returns the matching HTTP response.- Returns:
- The HTTP response.
-
parse
public static PushedAuthorizationSuccessResponse parse(net.minidev.json.JSONObject jsonObject) throws ParseException
Parses pushed authorisation success response from the specified JSON object.- Parameters:
jsonObject
- The JSON object to parse. Must not benull
.- Returns:
- The pushed authorisation success response.
- Throws:
ParseException
- If the JSON object couldn't be parsed to a pushed authorisation success response.
-
parse
public static PushedAuthorizationSuccessResponse parse(HTTPResponse httpResponse) throws ParseException
Parses a pushed authorisation success response from the specified HTTP response.- Parameters:
httpResponse
- The HTTP response. Must not benull
.- Returns:
- The pushed authorisation success response.
- Throws:
ParseException
- If the HTTP response couldn't be parsed to a pushed authorisation success response.
-
-