policies
Creates, updates, deletes, gets or lists a policies resource.
Overview​
| Name | policies |
| Type | Resource |
| Id | okta.authorizationservers.policies |
Fields​
The following fields are returned by SELECT queries:
- get_authorization_server_policy
- list_authorization_server_policies
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the Policy |
name | string | Name of the Policy |
_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. |
conditions | object | |
created | string (date-time) | Timestamp when the Policy was created |
description | string | Description of the Policy |
lastUpdated | string (date-time) | Timestamp when the Policy was last updated |
priority | integer | Specifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server |
status | string | Specifies whether requests have access to this Policy (ACTIVE, INACTIVE) |
system | boolean | Specifies whether Okta created this Policy |
type | string | Indicates that the Policy is an authorization server Policy (OAUTH_AUTHORIZATION_POLICY) |
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the Policy |
name | string | Name of the Policy |
_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. |
conditions | object | |
created | string (date-time) | Timestamp when the Policy was created |
description | string | Description of the Policy |
lastUpdated | string (date-time) | Timestamp when the Policy was last updated |
priority | integer | Specifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server |
status | string | Specifies whether requests have access to this Policy (ACTIVE, INACTIVE) |
system | boolean | Specifies whether Okta created this Policy |
type | string | Indicates that the Policy is an authorization server Policy (OAUTH_AUTHORIZATION_POLICY) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_authorization_server_policy | select | authServerId, policyId, subdomain | Retrieves a policy | |
list_authorization_server_policies | select | authServerId, subdomain | Lists all policies | |
create_authorization_server_policy | insert | authServerId, subdomain | Creates a policy | |
replace_authorization_server_policy | replace | authServerId, policyId, subdomain | Replaces a policy | |
delete_authorization_server_policy | delete | authServerId, policyId, subdomain | Deletes a policy | |
activate_authorization_server_policy | exec | authServerId, policyId, subdomain | Activates an authorization server policy | |
deactivate_authorization_server_policy | exec | authServerId, policyId, subdomain | Deactivates an authorization server policy |
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 |
policyId | string | id of the policy |
subdomain | string | (default: my-org) |
SELECT examples​
- get_authorization_server_policy
- list_authorization_server_policies
Retrieves a policy
SELECT
id,
name,
_links,
conditions,
created,
description,
lastUpdated,
priority,
status,
system,
type
FROM okta.authorizationservers.policies
WHERE authServerId = '{{ authServerId }}' -- required
AND policyId = '{{ policyId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;
Lists all policies
SELECT
id,
name,
_links,
conditions,
created,
description,
lastUpdated,
priority,
status,
system,
type
FROM okta.authorizationservers.policies
WHERE authServerId = '{{ authServerId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;
INSERT examples​
- create_authorization_server_policy
- Manifest
Creates a policy
INSERT INTO okta.authorizationservers.policies (
id,
type,
name,
conditions,
description,
priority,
status,
system,
authServerId,
subdomain
)
SELECT
'{{ id }}',
'{{ type }}',
'{{ name }}',
'{{ conditions }}',
'{{ description }}',
{{ priority }},
'{{ status }}',
{{ system }},
'{{ authServerId }}',
'{{ subdomain }}'
RETURNING
id,
name,
_links,
conditions,
created,
description,
lastUpdated,
priority,
status,
system,
type
;
# Description fields are for documentation purposes
- name: policies
props:
- name: authServerId
value: "{{ authServerId }}"
description: Required parameter for the policies resource.
- name: subdomain
value: "{{ subdomain }}"
description: Required parameter for the policies resource.
- name: id
value: "{{ id }}"
description: |
ID of the Policy
- name: type
value: "{{ type }}"
description: |
Indicates that the Policy is an authorization server Policy
valid_values: ['OAUTH_AUTHORIZATION_POLICY']
- name: name
value: "{{ name }}"
description: |
Name of the Policy
- name: conditions
value:
clients:
include:
- "{{ include }}"
- name: description
value: "{{ description }}"
description: |
Description of the Policy
- name: priority
value: {{ priority }}
description: |
Specifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server
- name: status
value: "{{ status }}"
description: |
Specifies whether requests have access to this Policy
valid_values: ['ACTIVE', 'INACTIVE']
- name: system
value: {{ system }}
description: |
Specifies whether Okta created this Policy
REPLACE examples​
- replace_authorization_server_policy
Replaces a policy
REPLACE okta.authorizationservers.policies
SET
id = '{{ id }}',
type = '{{ type }}',
name = '{{ name }}',
conditions = '{{ conditions }}',
description = '{{ description }}',
priority = {{ priority }},
status = '{{ status }}',
system = {{ system }}
WHERE
authServerId = '{{ authServerId }}' --required
AND policyId = '{{ policyId }}' --required
AND subdomain = '{{ subdomain }}' --required
RETURNING
id,
name,
_links,
conditions,
created,
description,
lastUpdated,
priority,
status,
system,
type;
DELETE examples​
- delete_authorization_server_policy
Deletes a policy
DELETE FROM okta.authorizationservers.policies
WHERE authServerId = '{{ authServerId }}' --required
AND policyId = '{{ policyId }}' --required
AND subdomain = '{{ subdomain }}' --required
;
Lifecycle Methods​
- activate_authorization_server_policy
- deactivate_authorization_server_policy
Activates an authorization server policy
EXEC okta.authorizationservers.policies.activate_authorization_server_policy
@authServerId='{{ authServerId }}' --required,
@policyId='{{ policyId }}' --required,
@subdomain='{{ subdomain }}' --required
;
Deactivates an authorization server policy
EXEC okta.authorizationservers.policies.deactivate_authorization_server_policy
@authServerId='{{ authServerId }}' --required,
@policyId='{{ policyId }}' --required,
@subdomain='{{ subdomain }}' --required
;