@Immutable public class UserInfoSuccessResponse extends UserInfoResponse implements SuccessResponse
The UserInfo claims may be passed as an unprotected JSON object or as a plain, signed or encrypted JSON Web Token (JWT). Use the appropriate constructor for that.
Example UserInfo HTTP response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"sub" : "248289761001",
"name" : "Jane Doe"
"given_name" : "Jane",
"family_name" : "Doe",
"email" : "janedoe@example.com",
"picture" : "http://example.com/janedoe/me.jpg"
}
Related specifications:
| Constructor and Description |
|---|
UserInfoSuccessResponse(com.nimbusds.jwt.JWT jwt)
Creates a new UserInfo success response where the claims are
specified as a plain, signed or encrypted JSON Web Token (JWT).
|
UserInfoSuccessResponse(UserInfo claimsSet)
Creates a new UserInfo success response where the claims are
specified as an unprotected UserInfo claims set.
|
| Modifier and Type | Method and Description |
|---|---|
javax.mail.internet.ContentType |
getContentType()
Gets the content type of this UserInfo response.
|
UserInfo |
getUserInfo()
Gets the UserInfo claims set as an unprotected UserInfo claims set.
|
com.nimbusds.jwt.JWT |
getUserInfoJWT()
Gets the UserInfo claims set as a plain, signed or encrypted JSON
Web Token (JWT).
|
boolean |
indicatesSuccess()
Checks if the response indicates success.
|
static UserInfoSuccessResponse |
parse(HTTPResponse httpResponse)
Parses a UserInfo response from the specified HTTP response.
|
HTTPResponse |
toHTTPResponse()
Returns the matching HTTP response.
|
public UserInfoSuccessResponse(UserInfo claimsSet)
claimsSet - The UserInfo claims set. Must not be null.public UserInfoSuccessResponse(com.nimbusds.jwt.JWT jwt)
jwt - The UserInfo claims set. Must not be null.public boolean indicatesSuccess()
ResponseindicatesSuccess in interface Responsetrue if the response indicates success, else
false.public javax.mail.internet.ContentType getContentType()
public UserInfo getUserInfo()
null if it was specified as
JSON Web Token (JWT) instead.public com.nimbusds.jwt.JWT getUserInfoJWT()
null if it was specified as an unprotected UserInfo
claims set instead.public HTTPResponse toHTTPResponse()
ResponsetoHTTPResponse in interface Responsepublic static UserInfoSuccessResponse parse(HTTPResponse httpResponse) throws ParseException
Example HTTP response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"sub" : "248289761001",
"name" : "Jane Doe"
"given_name" : "Jane",
"family_name" : "Doe",
"email" : "janedoe@example.com",
"picture" : "http://example.com/janedoe/me.jpg"
}
httpResponse - The HTTP response. Must not be null.ParseException - If the HTTP response couldn't be parsed to a
UserInfo response.Copyright © 2017 Connect2id Ltd.. All rights reserved.