Skip to main content

Configuring Resource Scopes

Resource scopes follow those registered with the Authorization Server (found at: AS_BASE_URL/registry/resource/resource_definition)

Scopes are kept very general since they are reused by many Authorization Servers.

Request Attributes

ParameterDescriptionExample valueRequiredLocalizable
scopeAn identifier for the scopereadYesNo
displayNameA human-readable name for the scopeReadNoYes

Sample Requests

Create a new Resource Scope

curl -X POST '{{WS_ADMIN_URI}}/resource-scope' \
--header 'Content-Type: application/vnd.api+json' \
--header 'ApiVersion: v1.0' \
--header 'Authorization: {{WS_ADMIN_STATIC_TOKEN}}' \
--header 'Accept-Language: en' \
--data-raw '{
"data": {
"type": "resource-scope",
"id": 1,
"attributes": {
"scope": "read",
"displayName": "Read"
}
}
}'

Get existing Resource Scopes

curl -X POST '{{WS_ADMIN_URI}}/resource-scope' \
--header 'Content-Type: application/vnd.api+json' \
--header 'ApiVersion: v1.0' \
--header 'Authorization: {{WS_ADMIN_STATIC_TOKEN}}' \
--header 'Accept-Language: en'

Update an existing Resource Scope

curl -X PATCH '{{WS_ADMIN_URI}}/resource-scope/1' \
--header 'Content-Type: application/vnd.api+json; ext=jsonpatch' \
--header 'ApiVersion: v1.0' \
--header 'Authorization: {{WS_ADMIN_STATIC_TOKEN}}' \
--header 'Accept-Language: en' \
--data-raw '{
"data": {
"type": "resource-scope",
"id": 1,
"attributes": {
"scope": "write",
"displayName": "Write"
}
}
}'
note

For details on how to add localization options for a Resource Scope, refer to the Localization for the Wallet Server API chapter.