Skip to main content

claims

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

Overview​

Nameclaims
TypeResource
Idokta.authorizationservers.claims

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringID of the Claim
namestringName of the Claim
_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.
alwaysIncludeInTokenbooleanSpecifies whether to include Claims in the token. The value is always TRUE for access token Claims. If the value is set to FALSE for an ID token claim, the Claim isn't included in the ID token when the token is requested with the access token or with the authorization_code. The client instead uses the access token to get Claims from the /userinfo endpoint.
claimTypestringSpecifies whether the Claim is for an access token (RESOURCE) or an ID token (IDENTITY) (IDENTITY, RESOURCE)
conditionsobjectSpecifies the scopes for the Claim
group_filter_typestringSpecifies the type of group filter if valueType is GROUPS If valueType is GROUPS, then the groups returned are filtered according to the value of group_filter_type. If you have complex filters for Groups, you can create a Groups allowlist to put them all in a Claim. (CONTAINS, EQUALS, REGEX, STARTS_WITH)
statusstring (ACTIVE, INACTIVE)
systembooleanWhen true, indicates that Okta created the Claim
valuestringSpecifies the value of the Claim. This value must be a string literal if valueType is GROUPS, and the string literal is matched with the selected group_filter_type. The value must be an Okta EL expression if valueType is EXPRESSION.
valueTypestringSpecifies whether the Claim is an Okta Expression Language (EL) expression (EXPRESSION), a set of groups (GROUPS), or a system claim (SYSTEM) (EXPRESSION, GROUPS, SYSTEM)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_oauth2_claimselectauthServerId, claimId, subdomainRetrieves a custom token Claim by the specified claimId
list_oauth2_claimsselectauthServerId, subdomainLists all custom token Claims defined for a specified custom authorization server
create_oauth2_claiminsertauthServerId, subdomainCreates a custom token Claim for a custom authorization server
replace_oauth2_claimreplaceauthServerId, claimId, subdomainReplaces a custom token Claim specified by the claimId
delete_oauth2_claimdeleteauthServerId, claimId, subdomainDeletes a custom token Claim specified by the claimId

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
claimIdstringid of Claim
subdomainstring(default: my-org)

SELECT examples​

Retrieves a custom token Claim by the specified claimId

SELECT
id,
name,
_links,
alwaysIncludeInToken,
claimType,
conditions,
group_filter_type,
status,
system,
value,
valueType
FROM okta.authorizationservers.claims
WHERE authServerId = '{{ authServerId }}' -- required
AND claimId = '{{ claimId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;

INSERT examples​

Creates a custom token Claim for a custom authorization server

INSERT INTO okta.authorizationservers.claims (
alwaysIncludeInToken,
claimType,
conditions,
group_filter_type,
name,
status,
system,
value,
valueType,
authServerId,
subdomain
)
SELECT
{{ alwaysIncludeInToken }},
'{{ claimType }}',
'{{ conditions }}',
'{{ group_filter_type }}',
'{{ name }}',
'{{ status }}',
{{ system }},
'{{ value }}',
'{{ valueType }}',
'{{ authServerId }}',
'{{ subdomain }}'
RETURNING
id,
name,
_links,
alwaysIncludeInToken,
claimType,
conditions,
group_filter_type,
status,
system,
value,
valueType
;

REPLACE examples​

Replaces a custom token Claim specified by the claimId

REPLACE okta.authorizationservers.claims
SET
alwaysIncludeInToken = {{ alwaysIncludeInToken }},
claimType = '{{ claimType }}',
conditions = '{{ conditions }}',
group_filter_type = '{{ group_filter_type }}',
name = '{{ name }}',
status = '{{ status }}',
system = {{ system }},
value = '{{ value }}',
valueType = '{{ valueType }}'
WHERE
authServerId = '{{ authServerId }}' --required
AND claimId = '{{ claimId }}' --required
AND subdomain = '{{ subdomain }}' --required
RETURNING
id,
name,
_links,
alwaysIncludeInToken,
claimType,
conditions,
group_filter_type,
status,
system,
value,
valueType;

DELETE examples​

Deletes a custom token Claim specified by the claimId

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