Skip to main content

application_users

Creates, updates, deletes, gets or lists an application_users resource.

Overview

Nameapplication_users
TypeResource
Idokta.apps.application_users

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringUnique identifier for the Okta user (example: 00u11z6WHMYCGPCHCRFK)
_embeddedobjectEmbedded resources related to the application user using the JSON Hypertext Application Language specification
_linksobjectSpecifies link relations (see Web Linking) available using the JSON Hypertext Application Language specification. This object is used for dynamic discovery of resources related to the application user.
createdstring (date-time)Timestamp when the object was created (example: 2017-03-28T01:11:10.000Z)
credentialsobjectSpecifies a user's credentials for the app. This parameter can be omitted for apps with sign-on mode (signOnMode) or authentication schemes (credentials.scheme) that don't require credentials.
externalIdstringThe ID of the user in the target app that's linked to the Okta application user object. This value is the native app-specific identifier or primary key for the user in the target app. The externalId is set during import when the user is confirmed (reconciled) or during provisioning when the user is created in the target app. This value isn't populated for SSO app assignments (for example, SAML or SWA) because it isn't synchronized with a target app. (example: 70c14cc17d3745e8a9f98d599a68329c)
lastSyncstring (date-time)Timestamp of the last synchronization operation. This value is only updated for apps with the IMPORT_PROFILE_UPDATES or PUSH PROFILE_UPDATES feature. (example: 2014-06-24T15:27:59.000Z)
lastUpdatedstring (date-time)Timestamp when the object was last updated (example: 2014-06-24T15:28:14.000Z)
passwordChangedstring (date-time)Timestamp when the application user password was last changed (example: 2014-06-24T15:27:59.000Z)
profileobjectSpecifies the default and custom profile properties for a user. Properties that are visible in the Admin Console for an app assignment can also be assigned through the API. Some properties are reference properties that are imported from the target app and can't be configured. See profile.
scopestringIndicates if the assignment is direct (USER) or by group membership (GROUP). (example: USER)
statusstringStatus of an application user (example: ACTIVE)
statusChangedstring (date-time)Timestamp when the application user status was last changed (example: 2014-06-24T15:28:14.000Z)
syncStatestringThe synchronization state for the application user. The application user's syncState depends on whether the PROFILE_MASTERING feature is enabled for the app. > Note: User provisioning currently must be configured through the Admin Console. (example: SYNCHRONIZED)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_application_usersselectsubdomainafter, limit, q, expandLists all assigned users for an app
get_application_userselectsubdomainexpandRetrieves a specific user assignment for a specific app
assign_user_to_applicationinsertsubdomain, data__idAssigns a user to an app for:

* SSO only<br>
Assignments to SSO apps typically don't include a user profile.
However, if your SSO app requires a profile but doesn't have provisioning enabled, you can add profile attributes in the request body.

* SSO and provisioning<br>
Assignments to SSO and provisioning apps typically include credentials and an app-specific profile.
Profile mappings defined for the app are applied first before applying any profile properties that are specified in the request body.
> Notes:
> * When Universal Directory is enabled, you can only specify profile properties that aren't defined in profile mappings.
> * Omit mapped properties during assignment to minimize assignment errors.
update_application_userupdatesubdomainUpdates the profile or credentials of a user assigned to an app
unassign_user_from_applicationdeletesubdomainsendEmailUnassigns a user from an app

For directories like Active Directory and LDAP, they act as the owner of the user's credential with Okta delegating authentication (DelAuth) to that directory.
If this request is successful for a user when DelAuth is enabled, then the user is in a state with no password. You can then reset the user's password.

> Important: This is a destructive operation. You can't recover the user's app profile. If the app is enabled for provisioning and configured to deactivate users, the user is also deactivated in the target app.

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
subdomainstringThe domain of your organization. This can be a provided subdomain of an official okta domain (okta.com, oktapreview.com, etc) or one of your configured custom domains. (default: my-org)
afterstringSpecifies the pagination cursor for the next page of results. Treat this as an opaque value obtained through the next link relationship. See [Pagination]https://developer.okta.com/docs/api#pagination.
expandstringAn optional query parameter to return the corresponding User object in the _embedded property. Valid value: user
limitinteger (int32)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]https://developer.okta.com/docs/api#pagination.
qstringSpecifies a filter for the list of application users returned based on their profile attributes. The value of q is matched against the beginning of the following profile attributes: userName, firstName, lastName, and email. This filter only supports the startsWith operation that matches the q string against the beginning of the attribute values. > Note: For OIDC apps, user profiles don't contain the firstName or lastName attributes. Therefore, the query only matches against the userName or email attributes.
sendEmailbooleanSends a deactivation email to the administrator if true

SELECT examples

Lists all assigned users for an app

SELECT
id,
_embedded,
_links,
created,
credentials,
externalId,
lastSync,
lastUpdated,
passwordChanged,
profile,
scope,
status,
statusChanged,
syncState
FROM okta.apps.application_users
WHERE subdomain = '{{ subdomain }}' -- required
AND after = '{{ after }}'
AND limit = '{{ limit }}'
AND q = '{{ q }}'
AND expand = '{{ expand }}';

INSERT examples

Assigns a user to an app for:

* SSO only<br>
Assignments to SSO apps typically don't include a user profile.
However, if your SSO app requires a profile but doesn't have provisioning enabled, you can add profile attributes in the request body.

* SSO and provisioning<br>
Assignments to SSO and provisioning apps typically include credentials and an app-specific profile.
Profile mappings defined for the app are applied first before applying any profile properties that are specified in the request body.
> Notes:
> * When Universal Directory is enabled, you can only specify profile properties that aren't defined in profile mappings.
> * Omit mapped properties during assignment to minimize assignment errors.

INSERT INTO okta.apps.application_users (
data__credentials,
data__id,
data__profile,
data__scope,
subdomain
)
SELECT
'{{ credentials }}',
'{{ id }}' --required,
'{{ profile }}',
'{{ scope }}',
'{{ subdomain }}'
RETURNING
id,
_embedded,
_links,
created,
credentials,
externalId,
lastSync,
lastUpdated,
passwordChanged,
profile,
scope,
status,
statusChanged,
syncState
;

UPDATE examples

Updates the profile or credentials of a user assigned to an app

UPDATE okta.apps.application_users
SET
-- No updatable properties
WHERE
subdomain = '{{ subdomain }}' --required
RETURNING
id,
_embedded,
_links,
created,
credentials,
externalId,
lastSync,
lastUpdated,
passwordChanged,
profile,
scope,
status,
statusChanged,
syncState;

DELETE examples

Unassigns a user from an app

For directories like Active Directory and LDAP, they act as the owner of the user's credential with Okta delegating authentication (DelAuth) to that directory.
If this request is successful for a user when DelAuth is enabled, then the user is in a state with no password. You can then reset the user's password.

> Important: This is a destructive operation. You can't recover the user's app profile. If the app is enabled for provisioning and configured to deactivate users, the user is also deactivated in the target app.

DELETE FROM okta.apps.application_users
WHERE subdomain = '{{ subdomain }}' --required
AND sendEmail = '{{ sendEmail }}';