com.nimbusds.openid.connect.sdk
Class UserInfoRequest

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

@Immutable
public final class UserInfoRequest
extends ProtectedResourceRequest

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

Example HTTP GET request:

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

Related specifications:

Author:
Vladimir Dzhuvinov

Constructor Summary
UserInfoRequest(URL uri, BearerAccessToken accessToken)
          Creates a new UserInfo HTTP GET request.
UserInfoRequest(URL uri, HTTPRequest.Method httpMethod, BearerAccessToken accessToken)
          Creates a new UserInfo request.
 
Method Summary
 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()
          Returns the matching HTTP request.
 
Methods inherited from class com.nimbusds.oauth2.sdk.ProtectedResourceRequest
getAccessToken
 
Methods inherited from class com.nimbusds.oauth2.sdk.AbstractRequest
getURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserInfoRequest

public UserInfoRequest(URL 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(URL 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

getMethod

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

Returns:
The HTTP method.

toHTTPRequest

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

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.