Class UserInfoRequest

  • All Implemented Interfaces:
    Message, Request

    @Immutable
    public class UserInfoRequest
    extends ProtectedResourceRequest
    UserInfo request. Used to retrieve the consented claims about the end-user.

    Example HTTP GET request:

     GET /userinfo HTTP/1.1
     Host: server.example.com
     Authorization: Bearer SlAV32hkKG
     

    Related specifications:

    • OpenID Connect Core 1.0, section 5.3.1.
    • OAuth 2.0 Bearer Token Usage (RFC6750), section 2.
    • Constructor Detail

      • UserInfoRequest

        public UserInfoRequest​(URI uri,
                               BearerAccessToken accessToken)
        Creates a new UserInfo HTTP GET request.
        Parameters:
        uri - The URI of the UserInfo endpoint. May be null if the toHTTPRequest() method will not be used.
        accessToken - An OAuth 2.0 Bearer access token for the request. Must not be null.
      • UserInfoRequest

        public UserInfoRequest​(URI uri,
                               HTTPRequest.Method httpMethod,
                               BearerAccessToken accessToken)
        Creates a new UserInfo request.
        Parameters:
        uri - The URI of the UserInfo endpoint. May be null if the toHTTPRequest() method will not be used.
        httpMethod - The HTTP method. Must be HTTP GET or POST and not null.
        accessToken - An OAuth 2.0 Bearer access token for the request. Must not be null.
    • Method Detail

      • toHTTPRequest

        public HTTPRequest toHTTPRequest()
        Description copied from interface: Request
        Returns the matching HTTP request.
        Returns:
        The HTTP request.
      • parse

        public static UserInfoRequest parse​(HTTPRequest httpRequest)
                                     throws ParseException
        Parses the specified HTTP request for a UserInfo request.
        Parameters:
        httpRequest - The HTTP request. Must not be null.
        Returns:
        The UserInfo request.
        Throws:
        ParseException - If the HTTP request couldn't be parsed to a UserInfo request.