Skip to main content

token_lifetime_policies

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

Overview

Nametoken_lifetime_policies
TypeResource
Identra_id.applications.token_lifetime_policies

Fields

The following fields are returned by SELECT queries:

Retrieved collection

NameDatatypeDescription
idstringThe unique identifier for an entity. Read-only.
appliesToarray
definitionarrayA string collection containing a JSON string that defines the rules and settings for a policy. The syntax for the definition differs for each derived policy type. Required.
deletedDateTimestring (date-time)Date and time when this object was deleted. Always null when the object hasn't been deleted. (pattern: ^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$)
descriptionstringDescription for this policy. Required.
displayNamestringDisplay name for this policy. Required.
isOrganizationDefaultbooleanIf set to true, activates this policy. There can be many policies for the same policy type, but only one can be activated as the organization default. Optional, default value is false.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectapplication_idList the tokenLifetimePolicy objects that are assigned to an application. Only one object is returned in the collection because only one tokenLifetimePolicy can be assigned to an application.
add_refinsertapplication_idAssign a tokenLifetimePolicy to an application. You can have multiple tokenLifetimePolicy policies in a tenant but can assign only one tokenLifetimePolicy per application.
remove_refdeleteapplication_id, token_lifetime_policy_idIf-MatchRemove a tokenLifetimePolicy from an application.
remove_ref_2deleteapplication_idIf-MatchRemove a tokenLifetimePolicy from an application.

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
application_idstringThe unique identifier of application
token_lifetime_policy_idstringThe unique identifier of tokenLifetimePolicy
If-MatchstringETag

SELECT examples

List the tokenLifetimePolicy objects that are assigned to an application. Only one object is returned in the collection because only one tokenLifetimePolicy can be assigned to an application.

SELECT
id,
appliesTo,
definition,
deletedDateTime,
description,
displayName,
isOrganizationDefault
FROM entra_id.applications.token_lifetime_policies
WHERE application_id = '{{ application_id }}' -- required
;

INSERT examples

Assign a tokenLifetimePolicy to an application. You can have multiple tokenLifetimePolicy policies in a tenant but can assign only one tokenLifetimePolicy per application.

INSERT INTO entra_id.applications.token_lifetime_policies (
directoryObjectId,
application_id
)
SELECT
'{{ directoryObjectId }}',
'{{ application_id }}'
;

DELETE examples

Remove a tokenLifetimePolicy from an application.

DELETE FROM entra_id.applications.token_lifetime_policies
WHERE application_id = '{{ application_id }}' --required
AND token_lifetime_policy_id = '{{ token_lifetime_policy_id }}' --required
AND If-Match = '{{ If-Match }}'
;