Skip to main content

policies

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

Overview​

Namepolicies
TypeResource
Idokta.authorizationservers.policies

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringID of the Policy
namestringName of the Policy
_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.
conditionsobject
createdstring (date-time)Timestamp when the Policy was created
descriptionstringDescription of the Policy
lastUpdatedstring (date-time)Timestamp when the Policy was last updated
priorityintegerSpecifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server
statusstringSpecifies whether requests have access to this Policy (ACTIVE, INACTIVE)
systembooleanSpecifies whether Okta created this Policy
typestringIndicates that the Policy is an authorization server Policy (OAUTH_AUTHORIZATION_POLICY)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_authorization_server_policyselectauthServerId, policyId, subdomainRetrieves a policy
list_authorization_server_policiesselectauthServerId, subdomainLists all policies
create_authorization_server_policyinsertauthServerId, subdomainCreates a policy
replace_authorization_server_policyreplaceauthServerId, policyId, subdomainReplaces a policy
delete_authorization_server_policydeleteauthServerId, policyId, subdomainDeletes a policy
activate_authorization_server_policyexecauthServerId, policyId, subdomainActivates an authorization server policy
deactivate_authorization_server_policyexecauthServerId, policyId, subdomainDeactivates 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.

NameDatatypeDescription
authServerIdstringid of the Authorization Server
policyIdstringid of the policy
subdomainstring(default: my-org)

SELECT examples​

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
;

INSERT examples​

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
;

REPLACE examples​

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​

Deletes a policy

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

Lifecycle Methods​

Activates an authorization server policy

EXEC okta.authorizationservers.policies.activate_authorization_server_policy
@authServerId='{{ authServerId }}' --required,
@policyId='{{ policyId }}' --required,
@subdomain='{{ subdomain }}' --required
;