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
-
@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 Summary
Constructors Constructor Description UserInfoRequest(URI uri, HTTPRequest.Method httpMethod, BearerAccessToken accessToken)Creates a new UserInfo request.UserInfoRequest(URI uri, BearerAccessToken accessToken)Creates a new UserInfo HTTP GET request.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HTTPRequest.MethodgetMethod()Gets the HTTP method for this UserInfo request.static UserInfoRequestparse(HTTPRequest httpRequest)Parses the specified HTTP request for a UserInfo request.HTTPRequesttoHTTPRequest()Returns the matching HTTP request.-
Methods inherited from class com.nimbusds.oauth2.sdk.ProtectedResourceRequest
getAccessToken
-
Methods inherited from class com.nimbusds.oauth2.sdk.AbstractRequest
getEndpointURI
-
-
-
-
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 benullif thetoHTTPRequest()method will not be used.accessToken- An OAuth 2.0 Bearer access token for the request. Must not benull.
-
UserInfoRequest
public UserInfoRequest(URI uri, HTTPRequest.Method httpMethod, BearerAccessToken accessToken)
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 OAuth 2.0 Bearer access token for the request. Must not benull.
-
-
Method Detail
-
getMethod
public HTTPRequest.Method getMethod()
Gets the HTTP method for this UserInfo request.- Returns:
- The HTTP method.
-
toHTTPRequest
public HTTPRequest toHTTPRequest()
Description copied from interface:RequestReturns 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 benull.- Returns:
- The UserInfo request.
- Throws:
ParseException- If the HTTP request couldn't be parsed to a UserInfo request.
-
-