Class PushedAuthorizationSuccessResponse

  • All Implemented Interfaces:
    Message, Response

    @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 Detail

      • PushedAuthorizationSuccessResponse

        public PushedAuthorizationSuccessResponse​(URI requestURI,
                                                  long lifetime)
        Creates a new pushed authorisation success response.
        Parameters:
        requestURI - The request URI. Must not be null.
        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, else false.
      • 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.
      • 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 be null.
        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 be null.
        Returns:
        The pushed authorisation success response.
        Throws:
        ParseException - If the HTTP response couldn't be parsed to a pushed authorisation success response.