scopes
Creates, updates, deletes, gets or lists a scopes resource.
Overview​
| Name | scopes |
| Type | Resource |
| Id | okta.authorizationservers.scopes |
Fields​
The following fields are returned by SELECT queries:
- get_oauth2_scope
- list_oauth2_scopes
| Name | Datatype | Description |
|---|---|---|
id | string | Scope object ID |
name | string | Scope name |
_links | object | Specifies 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. |
consent | string | Indicates whether a consent dialog is needed for the Scope (FLEXIBLE, IMPLICIT, REQUIRED) (default: IMPLICIT) |
default | boolean | Indicates if this Scope is a default scope |
description | string | Description of the Scope |
displayName | string | Name of the end user displayed in a consent dialog |
metadataPublish | string | Indicates whether the Scope is included in the metadata (ALL_CLIENTS, NO_CLIENTS) (default: NO_CLIENTS) |
optional | boolean | Indicates whether the Scope is optional. When set to true, the user can skip consent for the scope. |
system | boolean | Indicates if Okta created the Scope |
| Name | Datatype | Description |
|---|---|---|
id | string | Scope object ID |
name | string | Scope name |
_links | object | Specifies 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. |
consent | string | Indicates whether a consent dialog is needed for the Scope (FLEXIBLE, IMPLICIT, REQUIRED) (default: IMPLICIT) |
default | boolean | Indicates if this Scope is a default scope |
description | string | Description of the Scope |
displayName | string | Name of the end user displayed in a consent dialog |
metadataPublish | string | Indicates whether the Scope is included in the metadata (ALL_CLIENTS, NO_CLIENTS) (default: NO_CLIENTS) |
optional | boolean | Indicates whether the Scope is optional. When set to true, the user can skip consent for the scope. |
system | boolean | Indicates if Okta created the Scope |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_oauth2_scope | select | authServerId, scopeId, subdomain | Retrieves a custom token scope | |
list_oauth2_scopes | select | authServerId, subdomain | q, filter, after, limit | Lists all custom token scopes |
create_oauth2_scope | insert | authServerId, subdomain, name | Creates a custom token scope | |
replace_oauth2_scope | replace | authServerId, scopeId, subdomain, name | Replaces a custom token scope | |
delete_oauth2_scope | delete | authServerId, scopeId, subdomain | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
authServerId | string | id of the Authorization Server |
scopeId | string | id of Scope |
subdomain | string | (default: my-org) |
after | string | Specifies 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. |
filter | string | Filter expression for Custom Token Scopes |
limit | integer | Specifies 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. |
q | string | Searches the name of Custom Token Scopes for matching values |
SELECT examples​
- get_oauth2_scope
- list_oauth2_scopes
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
;
Lists all custom token scopes
SELECT
id,
name,
_links,
consent,
default,
description,
displayName,
metadataPublish,
optional,
system
FROM okta.authorizationservers.scopes
WHERE authServerId = '{{ authServerId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
AND q = '{{ q }}'
AND filter = '{{ filter }}'
AND after = '{{ after }}'
AND limit = '{{ limit }}'
;
INSERT examples​
- create_oauth2_scope
- Manifest
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
;
# Description fields are for documentation purposes
- name: scopes
props:
- name: authServerId
value: "{{ authServerId }}"
description: Required parameter for the scopes resource.
- name: subdomain
value: "{{ subdomain }}"
description: Required parameter for the scopes resource.
- name: consent
value: "{{ consent }}"
description: |
Indicates whether a consent dialog is needed for the Scope
valid_values: ['FLEXIBLE', 'IMPLICIT', 'REQUIRED']
default: IMPLICIT
- name: default
value: {{ default }}
description: |
Indicates if this Scope is a default scope
default: false
- name: description
value: "{{ description }}"
description: |
Description of the Scope
- name: displayName
value: "{{ displayName }}"
description: |
Name of the end user displayed in a consent dialog
- name: metadataPublish
value: "{{ metadataPublish }}"
description: |
Indicates whether the Scope is included in the metadata
valid_values: ['ALL_CLIENTS', 'NO_CLIENTS']
default: NO_CLIENTS
- name: name
value: "{{ name }}"
description: |
Scope name
- name: optional
value: {{ optional }}
description: |
Indicates whether the Scope is optional. When set to `true`, the user can skip consent for the scope.
default: false
- name: system
value: {{ system }}
description: |
Indicates if Okta created the Scope
default: false
REPLACE examples​
- replace_oauth2_scope
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​
- delete_oauth2_scope
Deletes a custom token scope
DELETE FROM okta.authorizationservers.scopes
WHERE authServerId = '{{ authServerId }}' --required
AND scopeId = '{{ scopeId }}' --required
AND subdomain = '{{ subdomain }}' --required
;