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 with a Bearer token:

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

Example HTTP GET request with a DPoP token and proof:

 GET /userinfo HTTP/1.1
 Host: server.example.com
 Authorization: DPoP jo4kahphoh1ath4INaochohLeeshaiyo
 DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVTMjU2IiwiandrIjp7Imt0eSI6Ik...
 

Related specifications:

  • OpenID Connect Core 1.0, section 5.3.1.
  • OAuth 2.0 Bearer Token Usage (RFC6750), section 2.
  • OAuth 2.0 Demonstrating Proof-of-Possession at the Application Layer (DPoP) (RFC 9449), section 7.
  • Constructor Details

    • UserInfoRequest

      public UserInfoRequest(URI uri, AccessToken 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 access token for the request. Must not be null.
    • UserInfoRequest

      public UserInfoRequest(URI uri, HTTPRequest.Method httpMethod, AccessToken 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 access token for the request. Must not be null.
  • Method Details

    • getMethod

      Gets the HTTP method for this UserInfo request.
      Returns:
      The HTTP method.
    • 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.