com.nimbusds.openid.connect.sdk
Class UserInfoRequest

java.lang.Object
  extended by com.nimbusds.openid.connect.sdk.UserInfoRequest
All Implemented Interfaces:
Message, Request

@Immutable
public final class UserInfoRequest
extends Object
implements Request

UserInfo request. Used to retrieve requested claims about the end-user. This class is immutable.

Example HTTP GET request:

 GET /userinfo?schema=openid HTTP/1.1
 Host: server.example.com
 Authorization: Bearer mF_9.B5f-4.1JqM
 

Example HTTP POST request:

 POST /userinfo HTTP/1.1
 Host: server.example.com
 Content-Type: application/x-www-form-urlencoded

 schema=openid&access_token=mF_9.B5f-4.1JqM
 

Related specifications:

Version:
$version$ (2013-05-10)
Author:
Vladimir Dzhuvinov

Constructor Summary
UserInfoRequest(AccessToken accessToken)
          Creates a new UserInfo HTTP GET request.
UserInfoRequest(HTTPRequest.Method httpMethod, AccessToken accessToken)
          Creates a new UserInfo request.
 
Method Summary
 AccessToken getAccessToken()
          Gets the UserInfo access token.
 HTTPRequest.Method getMethod()
          Gets the HTTP method for this UserInfo request.
static UserInfoRequest parse(HTTPRequest httpRequest)
          Parses the specified HTTP request for a UserInfo request.
 HTTPRequest toHTTPRequest(URL url)
          Returns the matching HTTP request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserInfoRequest

public UserInfoRequest(AccessToken accessToken)
Creates a new UserInfo HTTP GET request.

Parameters:
accessToken - The UserInfo access token. Must not be null.

UserInfoRequest

public UserInfoRequest(HTTPRequest.Method httpMethod,
                       AccessToken accessToken)
Creates a new UserInfo request.

Parameters:
httpMethod - The HTTP method. Must be HTTP GET or POST and not null.
accessToken - The UserInfo access token. Must not be null.
Method Detail

getMethod

public HTTPRequest.Method getMethod()
Gets the HTTP method for this UserInfo request.

Returns:
The HTTP method.

getAccessToken

public AccessToken getAccessToken()
Gets the UserInfo access token.

Returns:
The UserInfo access token.

toHTTPRequest

public HTTPRequest toHTTPRequest(URL url)
                          throws SerializeException
Description copied from interface: Request
Returns the matching HTTP request.

Specified by:
toHTTPRequest in interface Request
Parameters:
url - The URL of the HTTP endpoint for which the request is intended. Must not be null.
Returns:
The HTTP request.
Throws:
SerializeException - If the request message couldn't be serialised to an 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.


Copyright © 2013 NimbusDS. All Rights Reserved.