Create OpenID Connect resource scope
POST {{apiPath}}/environments/{{envID}}/resources/{{resourceID}}/scopes
The POST /environments/{{envID}}/resources/{{resourceID}}/scopes
operation adds a new custom resource scope. The request URL specifies the new scope's associated environment ID and resource ID.
The request body must specify a value for the scope name
property, and the name
value must be unique within the specified environment resource. If the resource's type
property is OPENID_CONNECT
, the request can also include the optional mappedClaims\[\]
property to add OpenID Connect mapped claims to the specified scope.
Prerequisites
Create a resource to get a
resourceID
for the endpoint. See also Resources, especially Resource operations.Create a resource attribute to get a
resourceAttrID
for the body. See also Resources, especially Resource Attributes.
Property | Type | Required? |
---|---|---|
description | String | Optional |
name | String | Required |
mappedClaims | String[] | Required |
See the Resource scopes data model for full property descriptions.
Request Body
{"name"=>"Scope_{{$timestamp}}", "description"=>"My scope with a mapped claim", "mappedClaims"=>["{{resourceAttrID}}"]}
RESPONSES
status: Created
{"_links":{"self":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/resources/71ff29d5-c666-4348-b54e-c5b64f0a80b8/scopes/18725af1-828f-4e60-afc1-4a7092eb275a"},"resource":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/resources/71ff29d5-c666-4348-b54e-c5b64f0a80b8"}},"id":"18725af1-828f-4e60-afc1-4a7092eb275a","environment":{"id":"abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"},"resource":{"id":"71ff29d5-c666-4348-b54e-c5b64f0a80b8"},"name":"Scope_1655153042","description":"My scope with a mapped claim","mappedClaims":["579dc6f8-bf83-43ae-816c-324506b5de21"],"createdAt":"2022-06-13T20:44:02.066Z","updatedAt":"2022-06-13T20:44:02.066Z"}