Package com.nimbusds.openid.connect.sdk
Class UserInfoRequest
java.lang.Object
com.nimbusds.oauth2.sdk.AbstractRequest
com.nimbusds.oauth2.sdk.ProtectedResourceRequest
com.nimbusds.openid.connect.sdk.UserInfoRequest
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) (draft-ietf-oauth-dpop-11), section 7.
-
Constructor Summary
ConstructorsConstructorDescriptionUserInfoRequest(URI uri, HTTPRequest.Method httpMethod, AccessToken accessToken) Creates a new UserInfo request.UserInfoRequest(URI uri, AccessToken accessToken) Creates a new UserInfo HTTP GET request. -
Method Summary
Modifier and TypeMethodDescriptionGets the HTTP method for this UserInfo request.static UserInfoRequestparse(HTTPRequest httpRequest) Parses the specified HTTP request for a UserInfo request.Returns the matching HTTP request.Methods inherited from class com.nimbusds.oauth2.sdk.ProtectedResourceRequest
getAccessTokenMethods inherited from class com.nimbusds.oauth2.sdk.AbstractRequest
getEndpointURI
-
Constructor Details
-
UserInfoRequest
Creates a new UserInfo HTTP GET request.- Parameters:
uri- The URI of the UserInfo endpoint. May benullif thetoHTTPRequest()method will not be used.accessToken- An access token for the request. Must not benull.
-
UserInfoRequest
Creates a new UserInfo request.- Parameters:
uri- The URI of the UserInfo endpoint. May benullif thetoHTTPRequest()method will not be used.httpMethod- The HTTP method. Must be HTTP GET or POST and notnull.accessToken- An access token for the request. Must not benull.
-
-
Method Details
-
getMethod
Gets the HTTP method for this UserInfo request.- Returns:
- The HTTP method.
-
toHTTPRequest
Description copied from interface:RequestReturns the matching HTTP request.- Returns:
- The HTTP request.
-
parse
Parses the specified HTTP request for a UserInfo request.- Parameters:
httpRequest- The HTTP request. Must not benull.- Returns:
- The UserInfo request.
- Throws:
ParseException- If the HTTP request couldn't be parsed to a UserInfo request.
-