public class Grant extends Object implements Serializable
This class holds the same information as the response from the Grant Management Endpoint on the grant management action 'query' does.
| Constructor and Description |
|---|
Grant() |
| Modifier and Type | Method and Description |
|---|---|
static Grant |
fromJson(String json)
Build a
Grant instance from a JSON string. |
AuthzDetails |
getAuthorizationDetails()
Get the authorization details.
|
String[] |
getClaims()
Get the claims.
|
GrantScope[] |
getScopes()
Get the grant scopes.
|
Grant |
setAuthorizationDetails(AuthzDetails details)
Set the authorization details.
|
Grant |
setClaims(String[] claims)
Set the claims
|
Grant |
setScopes(GrantScope[] scopes)
Set the grant scopes.
|
String |
toJson()
Convert this instance into a JSON string.
|
public GrantScope[] getScopes()
public Grant setScopes(GrantScope[] scopes)
scopes - The grant scopes.this object.public String[] getClaims()
public Grant setClaims(String[] claims)
claims - The claimsthis object.public AuthzDetails getAuthorizationDetails()
public Grant setAuthorizationDetails(AuthzDetails details)
details - The authorization details.this object.public String toJson()
The returned string contains a JSON object which has "scopes",
"claims" and "authorization_details" as top-level
properties.
public static Grant fromJson(String json)
Grant instance from a JSON string.
The following is an example of input JSON.
{
"scopes":[
{
"scope":"contacts read write",
"resource":[
"https://rs.example.com/api"
]
},
{
"scope":"openid"
}
],
"claims":[
"given_name",
"nickname",
"email",
"email_verified"
],
"authorization_details":[
{
"type":"account_information",
"actions":[
"list_accounts",
"read_balances",
"read_transactions"
],
"locations":[
"https://example.com/accounts"
]
}
]
}
json - A JSON string.Grant instance built from the input JSON.Copyright © 2022. All rights reserved.