Package com.nimbusds.openid.connect.sdk
Class UserInfoSuccessResponse
java.lang.Object
com.nimbusds.openid.connect.sdk.UserInfoResponse
com.nimbusds.openid.connect.sdk.UserInfoSuccessResponse
- All Implemented Interfaces:
Message
,Response
,SuccessResponse
UserInfo success response.
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" : "[email protected]", "picture" : "http://example.com/janedoe/me.jpg" }
Related specifications:
- OpenID Connect Core 1.0, section 5.3.2.
-
Constructor Summary
ConstructorsConstructorDescriptionUserInfoSuccessResponse
(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. -
Method Summary
Modifier and TypeMethodDescriptioncom.nimbusds.common.contenttype.ContentType
Gets the content type of this UserInfo response.Gets the UserInfo claims set as an unprotected UserInfo claims set.com.nimbusds.jwt.JWT
Gets the UserInfo claims set as a plain, signed or encrypted JSON Web Token (JWT).boolean
Checks if the response indicates success.static UserInfoSuccessResponse
parse
(HTTPResponse httpResponse) Parses a UserInfo response from the specified HTTP response.Returns the matching HTTP response.Methods inherited from class com.nimbusds.openid.connect.sdk.UserInfoResponse
toErrorResponse, toSuccessResponse
-
Constructor Details
-
UserInfoSuccessResponse
Creates a new UserInfo success response where the claims are specified as an unprotected UserInfo claims set.- Parameters:
claimsSet
- The UserInfo claims set. Must not benull
.
-
UserInfoSuccessResponse
Creates a new UserInfo success response where the claims are specified as a plain, signed or encrypted JSON Web Token (JWT).- Parameters:
jwt
- The UserInfo claims set. Must not benull
.
-
-
Method Details
-
indicatesSuccess
Description copied from interface:Response
Checks if the response indicates success.- Specified by:
indicatesSuccess
in interfaceResponse
- Returns:
true
if the response indicates success, elsefalse
.
-
getEntityContentType
Gets the content type of this UserInfo response.- Returns:
- The content type, according to the claims format.
-
getUserInfo
Gets the UserInfo claims set as an unprotected UserInfo claims set.- Returns:
- The UserInfo claims set,
null
if it was specified as JSON Web Token (JWT) instead.
-
getUserInfoJWT
Gets the UserInfo claims set as a plain, signed or encrypted JSON Web Token (JWT).- Returns:
- The UserInfo claims set as a JSON Web Token (JWT),
null
if it was specified as an unprotected UserInfo claims set instead.
-
toHTTPResponse
Description copied from interface:Response
Returns the matching HTTP response.- Specified by:
toHTTPResponse
in interfaceResponse
- Returns:
- The HTTP response.
-
parse
Parses a UserInfo response from the specified HTTP response.Example HTTP response:
HTTP/1.1 200 OK Content-Type: application/json { "sub" : "248289761001", "name" : "Jane Doe" "given_name" : "Jane", "family_name" : "Doe", "email" : "[email protected]", "picture" : "http://example.com/janedoe/me.jpg" }
- Parameters:
httpResponse
- The HTTP response. Must not benull
.- Returns:
- The UserInfo response.
- Throws:
ParseException
- If the HTTP response couldn't be parsed to a UserInfo response.
-