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 (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 (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
list_oauth2_scopesselectsubdomainq, filter, after, limitLists all custom token scopes
get_oauth2_scopeselectsubdomainRetrieves a custom token scope
create_oauth2_scopeinsertsubdomain, data__nameCreates a custom token scope
replace_oauth2_scopereplacesubdomain, data__nameReplaces a custom token scope
delete_oauth2_scopedeletesubdomainDeletes 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
subdomainstringThe domain of your organization. This can be a provided subdomain of an official okta domain (okta.com, oktapreview.com, etc) or one of your configured custom domains. (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

Lists all custom token scopes

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

INSERT examples

Creates a custom token scope

INSERT INTO okta.authorizationservers.scopes (
data__consent,
data__default,
data__description,
data__displayName,
data__metadataPublish,
data__name,
data__optional,
data__system,
subdomain
)
SELECT
'{{ consent }}',
{{ default }},
'{{ description }}',
'{{ displayName }}',
'{{ metadataPublish }}',
'{{ name }}' --required,
{{ optional }},
{{ system }},
'{{ subdomain }}'
RETURNING
id,
name,
_links,
consent,
default,
description,
displayName,
metadataPublish,
optional,
system
;

REPLACE examples

Replaces a custom token scope

REPLACE okta.authorizationservers.scopes
SET
data__consent = '{{ consent }}',
data__default = {{ default }},
data__description = '{{ description }}',
data__displayName = '{{ displayName }}',
data__metadataPublish = '{{ metadataPublish }}',
data__name = '{{ name }}',
data__optional = {{ optional }},
data__system = {{ system }}
WHERE
subdomain = '{{ subdomain }}' --required
AND data__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 subdomain = '{{ subdomain }}' --required;