okta_service_accounts
Creates, updates, deletes, gets or lists an okta_service_accounts resource.
Overview​
| Name | okta_service_accounts |
| Type | Resource |
| Id | okta.privileged_access.okta_service_accounts |
Fields​
The following fields are returned by SELECT queries:
- get_okta_managed_user_account
- list_okta_managed_user_accounts
| Name | Datatype | Description |
|---|---|---|
id | string (regex) | The UUID of the Okta managed user account (pattern: (?i)^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$, example: d1b65a78-21ed-429b-8ea3-eec96f2748d6) |
name | string (regex) | The user-defined name for the Okta managed user account (pattern: ^[\w-_. ]+$, example: AD Integrations Admin) |
created | string (date-time) | Timestamp when the Okta managed user account was created (example: 2023-04-04T15:56:05.000Z) |
description | string (regex) | The description of the Okta managed user account (example: Shared admin account for managing AD integrations) |
email | string | The email address associated with the Okta user. This parameter is read-only, and it is derived from the Okta user profile. (example: foo@bar.com) |
lastUpdated | string (date-time) | Timestamp when the Okta managed user account was last updated (example: 2023-05-05T18:15:44.000Z) |
oktaUserId | string | The ID of the Okta user being managed as a service account (example: 00u11s48P9zGW8yqm0g5) |
ownerGroupIds | array | A list of IDs of the Okta groups who own the Okta managed user account |
ownerUserIds | array | A list of IDs of the Okta users who own the Okta managed user account |
status | string | Describes the current status of a service account (ALERT, ERROR, INFO, NO_ISSUES, UNSECURED) (example: UNSECURED) |
statusDetail | string | Describes the detailed status of a service account (CREATION_FAILED, MISSING_PASSWORD, PENDING, ROTATED, ROTATING, ROTATION_FAILED, STAGED, UNMANAGED, VAULTED) (example: STAGED) |
username | string | The username associated with the Okta user. This parameter is read-only, and it is derived from the Okta user profile. (example: shr-ad-admin-01@example.com) |
An Okta managed user account representing a Universal Directory user managed as a service account
| Name | Datatype | Description |
|---|---|---|
id | string (regex) | The UUID of the Okta managed user account (pattern: (?i)^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$, example: d1b65a78-21ed-429b-8ea3-eec96f2748d6) |
name | string (regex) | The user-defined name for the Okta managed user account (pattern: ^[\w-_. ]+$, example: AD Integrations Admin) |
created | string (date-time) | Timestamp when the Okta managed user account was created (example: 2023-04-04T15:56:05.000Z) |
description | string (regex) | The description of the Okta managed user account (example: Shared admin account for managing AD integrations) |
email | string | The email address associated with the Okta user. This parameter is read-only, and it is derived from the Okta user profile. (example: foo@bar.com) |
lastUpdated | string (date-time) | Timestamp when the Okta managed user account was last updated (example: 2023-05-05T18:15:44.000Z) |
oktaUserId | string | The ID of the Okta user being managed as a service account (example: 00u11s48P9zGW8yqm0g5) |
ownerGroupIds | array | A list of IDs of the Okta groups who own the Okta managed user account |
ownerUserIds | array | A list of IDs of the Okta users who own the Okta managed user account |
status | string | Describes the current status of a service account (ALERT, ERROR, INFO, NO_ISSUES, UNSECURED) (example: UNSECURED) |
statusDetail | string | Describes the detailed status of a service account (CREATION_FAILED, MISSING_PASSWORD, PENDING, ROTATED, ROTATING, ROTATION_FAILED, STAGED, UNMANAGED, VAULTED) (example: STAGED) |
username | string | The username associated with the Okta user. This parameter is read-only, and it is derived from the Okta user profile. (example: shr-ad-admin-01@example.com) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_okta_managed_user_account | select | id, subdomain | Retrieves an Okta managed user account specified by ID | |
list_okta_managed_user_accounts | select | subdomain | limit, after, match | Lists all Okta managed user accounts in your org. Use the match parameter to search for accounts where the account name (name) or username (username) contains the specified value. |
create_okta_managed_user_account | insert | subdomain, name, oktaUserId | Creates a new Okta managed user account for managing a Universal Directory user as a service account. You must specify an existing Okta user in your org with the oktaUserId request parameter. | |
update_okta_managed_user_account | update | id, subdomain | Updates an existing Okta managed user account specified by ID. You can only update the name, description, ownerUserIds, and ownerGroupIds properties. | |
delete_okta_managed_user_account | delete | id, subdomain | Deletes an Okta managed user account specified by ID. This operation removes the service account management for the Okta user, suspends the underlying Okta user account, but doesn't delete the user from Universal Directory. |
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 |
|---|---|---|
id | string (regex) | ID of an existing Okta managed user account |
subdomain | string | (default: my-org) |
after | string | The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the Link response header. See Pagination and Link header. |
limit | integer | A limit on the number of objects to return |
match | string | Searches for Okta managed user accounts where the account name (name) or username (username) contains the given value |
SELECT examples​
- get_okta_managed_user_account
- list_okta_managed_user_accounts
Retrieves an Okta managed user account specified by ID
SELECT
id,
name,
created,
description,
email,
lastUpdated,
oktaUserId,
ownerGroupIds,
ownerUserIds,
status,
statusDetail,
username
FROM okta.privileged_access.okta_service_accounts
WHERE id = '{{ id }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;
Lists all Okta managed user accounts in your org.
Use the match parameter to search for accounts where the account name (name) or username (username) contains the specified value.
SELECT
id,
name,
created,
description,
email,
lastUpdated,
oktaUserId,
ownerGroupIds,
ownerUserIds,
status,
statusDetail,
username
FROM okta.privileged_access.okta_service_accounts
WHERE subdomain = '{{ subdomain }}' -- required
AND limit = '{{ limit }}'
AND after = '{{ after }}'
AND match = '{{ match }}'
;
INSERT examples​
- create_okta_managed_user_account
- Manifest
Creates a new Okta managed user account for managing a Universal Directory user as a service account.
You must specify an existing Okta user in your org with the oktaUserId request parameter.
INSERT INTO okta.privileged_access.okta_service_accounts (
description,
name,
oktaUserId,
ownerGroupIds,
ownerUserIds,
subdomain
)
SELECT
'{{ description }}',
'{{ name }}' /* required */,
'{{ oktaUserId }}' /* required */,
'{{ ownerGroupIds }}',
'{{ ownerUserIds }}',
'{{ subdomain }}'
RETURNING
id,
name,
created,
description,
email,
lastUpdated,
oktaUserId,
ownerGroupIds,
ownerUserIds,
status,
statusDetail,
username
;
# Description fields are for documentation purposes
- name: okta_service_accounts
props:
- name: subdomain
value: "{{ subdomain }}"
description: Required parameter for the okta_service_accounts resource.
- name: description
value: "{{ description }}"
description: |
The description of the Okta managed user account
- name: name
value: "{{ name }}"
description: |
The user-defined name for the Okta managed user account
- name: oktaUserId
value: "{{ oktaUserId }}"
description: |
The ID of the Okta user to manage as a service account.
This must be an existing user in your Okta org.
- name: ownerGroupIds
value:
- "{{ ownerGroupIds }}"
description: |
A list of IDs of the Okta groups who own the Okta managed user account
- name: ownerUserIds
value:
- "{{ ownerUserIds }}"
description: |
A list of IDs of the Okta users who own the Okta managed user account
UPDATE examples​
- update_okta_managed_user_account
Updates an existing Okta managed user account specified by ID.
You can only update the name, description, ownerUserIds, and ownerGroupIds properties.
UPDATE okta.privileged_access.okta_service_accounts
SET
description = '{{ description }}',
name = '{{ name }}',
ownerGroupIds = '{{ ownerGroupIds }}',
ownerUserIds = '{{ ownerUserIds }}'
WHERE
id = '{{ id }}' --required
AND subdomain = '{{ subdomain }}' --required
RETURNING
id,
name,
created,
description,
email,
lastUpdated,
oktaUserId,
ownerGroupIds,
ownerUserIds,
status,
statusDetail,
username;
DELETE examples​
- delete_okta_managed_user_account
Deletes an Okta managed user account specified by ID.
This operation removes the service account management for the Okta user, suspends the underlying Okta user account,
but doesn't delete the user from Universal Directory.
DELETE FROM okta.privileged_access.okta_service_accounts
WHERE id = '{{ id }}' --required
AND subdomain = '{{ subdomain }}' --required
;