public class UserInfoIssueRequest extends Object implements Serializable
/auth/userinfo/issue API.
token(REQUIRED)The access token that has been passed to the service's userinfo endpoint by the client application. In other words, the access token which was contained in the userinfo request.
claims(OPTIONAL)Claims in JSON format. As for the format, see
setClaims(String)and "OpenID Connect Core 1.0, 5.1. Standard Claims".sub(OPTIONAL)The value of the
subclaim. If the value of this request parameter is not empty, it is used as the value of the 'sub' claim. Otherwise, the value of the subject associated with the access token is used.claimsForTx(OPTIONAL; Authlete 2.3 onwards)Claim data that are referenced when Authlete computes values of transformed claims. See the description of
setClaimsForTx(String)for details.verifiedClaimsForTx(OPTIONAL; Authlete 2.3 onwards)Verified claim data that are referenced when Authlete computes values of transformed claims. See the description of
setVerifiedClaimsForTx(String[])for details.
| Constructor and Description |
|---|
UserInfoIssueRequest() |
| Modifier and Type | Method and Description |
|---|---|
String |
getClaims()
Get the claims of the subject in JSON format.
|
String |
getClaimsForTx()
Get values of claims requested indirectly by "transformed claims".
|
String |
getSub()
Get the value of the
sub claim. |
String |
getToken()
Get the access token which has come along with the userinfo
request from the client application.
|
String[] |
getVerifiedClaimsForTx()
Get values of verified claims requested indirectly by
"transformed claims".
|
UserInfoIssueRequest |
setClaims(Map<String,Object> claims)
Set the value of
"claims" which is the claims of the subject. |
UserInfoIssueRequest |
setClaims(String claims)
Set the claims of the subject in JSON format.
|
UserInfoIssueRequest |
setClaimsForTx(Map<String,Object> claims)
Set the value of
"claimsForTx" which is the claims of the
subject. |
UserInfoIssueRequest |
setClaimsForTx(String claims)
Set values of claims requested indirectly by "transformed claims".
|
UserInfoIssueRequest |
setSub(String sub)
Set the value of the
sub claim. |
UserInfoIssueRequest |
setToken(String token)
Set the access token which has been issued by Authlete.
|
UserInfoIssueRequest |
setVerifiedClaimsForTx(List<Map<String,Object>> list)
Set the value of
"verifiedClaimsForTx" which is the verified
claims of the subject. |
UserInfoIssueRequest |
setVerifiedClaimsForTx(String[] claims)
Set values of verified claims requested indirectly by
"transformed claims".
|
public String getToken()
public UserInfoIssueRequest setToken(String token)
public String getClaims()
setClaims(String) for details about the format.setClaims(String)public UserInfoIssueRequest setClaims(String claims)
The service implementation is required to retrieve claims of the subject (= information about the end-user) from its database and format them in JSON format.
For example, if "given_name" claim, "family_name"
claim and "email" claim are requested, the service implementation
should generate a JSON object like the following:
{
"given_name": "Takahiko",
"family_name": "Kawasaki",
"email": "takahiko.kawasaki@example.com"
}
and set its String representation by this method.
See OpenID Connect Core 1.0, 5.1. Standard Claims for further details about the format.
claims - The claims of the subject in JSON format.this object.public UserInfoIssueRequest setClaims(Map<String,Object> claims)
"claims" which is the claims of the subject.
The argument is converted into a JSON string and passed to setClaims(String) method.claims - The claims of the subject. Keys are claim names.this object.public String getSub()
sub claim. If this method returns a non-empty value,
it is used as the value of the 'sub' claim. Otherwise, the value of the subject
associated with the access token is used.sub claim.public UserInfoIssueRequest setSub(String sub)
sub claim. If a non-empty value is given, it is
used as the value of the 'sub' claim. Otherwise, the value of the subject
associated with the access token is used.sub - The value of the sub claim.this object.public String getClaimsForTx()
See the description of setClaimsForTx(String) for details.
setClaimsForTx(String)public UserInfoIssueRequest setClaimsForTx(String claims)
A client application may request "transformed claims". Each of
transformed claims uses an existing claim as input. As a result, to
compute the value of a transformed claim, the value of the referenced
existing claim is needed. This claimsForTx request parameter
has to be used to provide values of existing claims for computation of
transformed claims.
A response from the /api/auth/userinfo API may include the
requestedClaimsForTx response parameter which is a list of
claims that are referenced indirectly by transformed claims (cf.
UserInfoResponse.getRequestedClaimsForTx()). The authorization
server implementation should prepare values of the claims listed in
requestedClaimsForTx and pass them as the value of this claimsForTx request parameter.
The following is an example of the value of this request parameter.
{
"birthdate": "1970-01-23",
"nationalities": [ "DEU", "USA" ]
}
This request parameter (claimsForTx) is recognized by Authlete
2.3 onwards.
claims - Values of claims requested indirectly by "transformed claims".
The format is JSON.this object.UserInfoResponse.getRequestedClaimsForTx()public UserInfoIssueRequest setClaimsForTx(Map<String,Object> claims)
"claimsForTx" which is the claims of the
subject. The argument is converted into a JSON string and passed
to setClaimsForTx(String) method.claims - The claims of the subject. Keys are claim names.this object.public String[] getVerifiedClaimsForTx()
See the description of setVerifiedClaimsForTx(String[])
for details.
setVerifiedClaimsForTx(String[])public UserInfoIssueRequest setVerifiedClaimsForTx(String[] claims)
A client application may request "transformed claims". Each of
transformed claims uses an existing claim as input. As a result, to
compute the value of a transformed claim, the value of the referenced
existing claim is needed. This verifiedClaimsForTx request
parameter has to be used to provide values of existing claims for
computation of transformed claims.
A response from the /api/auth/userinfo API may include the
requestedVerifiedClaimsForTx response parameter which is a list
of verified claims that are referenced indirectly by transformed claims
(cf. UserInfoResponse.getRequestedVerifiedClaimsForTx()).
The authorization server implementation should prepare values of the
verified claims listed in requestedVerifiedClaimsForTx and pass
them as the value of this verifiedClaimsForTx request parameter.
The following is an example of the value of this request parameter.
[
"{\"birthdate\":\"1970-01-23\",\"nationalities\":[\"DEU\",\"USA\"]}"
]
The reason that this verifiedClaimsForTx property is an array
is that the "verified_claims" property in the claims
request parameter of an authorization request can be an array like below.
{
"transformed_claims": {
"nationality_usa": {
"claim": "nationalities",
"fn": [
[ "eq", "USA" ],
"any"
]
}
},
"userinfo": {
"verified_claims": [
{
"verification": { "trust_framework": { "value": "gold" } },
"claims": { "::18_or_above": null }
},
{
"verification": { "trust_framework": { "value": "silver" } },
"claims": { ":nationality_usa": null }
}
]
}
}
For the example above, the value of this verifiedClaimsForTx
property should be an array of size 2 and look like below. The first
element is JSON including claims which have been verified under the
trust framework "gold", and the second element is JSON including
claims which have been verified under the trust framework "silver".
[
"{\"birthdate\":\"1970-01-23\"}",
"{\"nationalities\":[\"DEU\",\"USA\"]}"
]
This request parameter (verifiedClaimsForTx) is recognized by
Authlete 2.3 onwards.
claims - Values of verified claims requested indirectly by
"transformed claims". The format of elements in the
array is JSON.this object.UserInfoResponse.getRequestedVerifiedClaimsForTx()public UserInfoIssueRequest setVerifiedClaimsForTx(List<Map<String,Object>> list)
"verifiedClaimsForTx" which is the verified
claims of the subject. Each element in the given list is converted to
a JSON string and a newly created string array containing the converted
elements is passed to setVerifiedClaimsForTx(String[]).list - List of clusters of verified claims.this object.Copyright © 2022. All rights reserved.