Skip to main content

scopes

Creates, updates, deletes, gets or lists a scopes resource.

Overview​

Namescopes
TypeResource
Idokta.authorizationservers.scopes

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringScope object ID
namestringScope name
_linksobjectSpecifies link relations (see Web Linking) available using the JSON Hypertext Application Language specification. This object is used for dynamic discovery of related resources and lifecycle operations.
consentstringIndicates whether a consent dialog is needed for the Scope (FLEXIBLE, IMPLICIT, REQUIRED) (default: IMPLICIT)
defaultbooleanIndicates if this Scope is a default scope
descriptionstringDescription of the Scope
displayNamestringName of the end user displayed in a consent dialog
metadataPublishstringIndicates whether the Scope is included in the metadata (ALL_CLIENTS, NO_CLIENTS) (default: NO_CLIENTS)
optionalbooleanIndicates whether the Scope is optional. When set to true, the user can skip consent for the scope.
systembooleanIndicates if Okta created the Scope

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_oauth2_scopeselectauthServerId, scopeId, subdomainRetrieves a custom token scope
list_oauth2_scopesselectauthServerId, subdomainq, filter, after, limitLists all custom token scopes
create_oauth2_scopeinsertauthServerId, subdomain, nameCreates a custom token scope
replace_oauth2_scopereplaceauthServerId, scopeId, subdomain, nameReplaces a custom token scope
delete_oauth2_scopedeleteauthServerId, scopeId, subdomainDeletes a custom token scope

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
authServerIdstringid of the Authorization Server
scopeIdstringid of Scope
subdomainstring(default: my-org)
afterstringSpecifies the pagination cursor for the next page of scopes. Treat the after cursor as an opaque value and obtain it through the next link relationship. See Pagination.
filterstringFilter expression for Custom Token Scopes
limitintegerSpecifies the number of objects to return per page. If there are multiple pages of results, the Link header contains a next link that you need to use as an opaque value (follow it, don't parse it). See Pagination.
qstringSearches the name of Custom Token Scopes for matching values

SELECT examples​

Retrieves a custom token scope

SELECT
id,
name,
_links,
consent,
default,
description,
displayName,
metadataPublish,
optional,
system
FROM okta.authorizationservers.scopes
WHERE authServerId = '{{ authServerId }}' -- required
AND scopeId = '{{ scopeId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;

INSERT examples​

Creates a custom token scope

INSERT INTO okta.authorizationservers.scopes (
consent,
default,
description,
displayName,
metadataPublish,
name,
optional,
system,
authServerId,
subdomain
)
SELECT
'{{ consent }}',
{{ default }},
'{{ description }}',
'{{ displayName }}',
'{{ metadataPublish }}',
'{{ name }}' /* required */,
{{ optional }},
{{ system }},
'{{ authServerId }}',
'{{ subdomain }}'
RETURNING
id,
name,
_links,
consent,
default,
description,
displayName,
metadataPublish,
optional,
system
;

REPLACE examples​

Replaces a custom token scope

REPLACE okta.authorizationservers.scopes
SET
consent = '{{ consent }}',
default = {{ default }},
description = '{{ description }}',
displayName = '{{ displayName }}',
metadataPublish = '{{ metadataPublish }}',
name = '{{ name }}',
optional = {{ optional }},
system = {{ system }}
WHERE
authServerId = '{{ authServerId }}' --required
AND scopeId = '{{ scopeId }}' --required
AND subdomain = '{{ subdomain }}' --required
AND name = '{{ name }}' --required
RETURNING
id,
name,
_links,
consent,
default,
description,
displayName,
metadataPublish,
optional,
system;

DELETE examples​

Deletes a custom token scope

DELETE FROM okta.authorizationservers.scopes
WHERE authServerId = '{{ authServerId }}' --required
AND scopeId = '{{ scopeId }}' --required
AND subdomain = '{{ subdomain }}' --required
;