Skip to main content

service_accounts

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

Overview​

Nameservice_accounts
TypeResource
Idokta.privileged_access.service_accounts

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (regex)The UUID of the app service 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: a747a818-a4c4-4446-8a87-704216495a08)
namestring (regex)The user-defined name for the app service account (pattern: ^[\w-_. ]+$, example: salesforce Prod-5 account)
containerGlobalNamestringThe key name of the app in the Okta Integration Network (OIN) (example: salesforce)
containerInstanceNamestringThe app instance label (example: salesforce Prod 5)
containerOrnstringThe ORN of the relevant resource. Use the specific app ORN format (orn:{partition}:idp:{yourOrgId}:apps:{appType}:{appId}) to identify an Okta app instance in your org. (example: orn:okta:idp:00o1n8sbwArJ7OQRw406:apps:salesforce:0oa1gjh63g214q0Hq0g4)
createdstring (date-time)Timestamp when the app service account was created
descriptionstring (regex)The description of the app service account (example: This is for accessing salesforce Prod-5)
lastUpdatedstring (date-time)Timestamp when the app service account was last updated
ownerGroupIdsarrayA list of IDs of the Okta groups who own the app service account
ownerUserIdsarrayA list of IDs of the Okta users who own the app service account
passwordstring (password)The app service account password
statusstringDescribes the current status of a service account (ALERT, ERROR, INFO, NO_ISSUES, UNSECURED) (example: UNSECURED)
statusDetailstringDescribes the detailed status of a service account (CREATION_FAILED, MISSING_PASSWORD, PENDING, ROTATED, ROTATING, ROTATION_FAILED, STAGED, UNMANAGED, VAULTED) (example: STAGED)
usernamestringThe username that serves as the direct link to your managed app account. Ensure that this value precisely matches the identifier of the target app account. (example: testuser-salesforce-5@example.com)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_app_service_accountselectid, subdomainRetrieves an app service account specified by ID
list_app_service_accountsselectsubdomainlimit, after, matchLists all app service accounts
create_app_service_accountinsertsubdomain, name, containerOrn, username, passwordCreates a new app service account for managing an app account
update_app_service_accountupdateid, subdomainUpdates an existing app service account specified by ID
delete_app_service_accountdeleteid, subdomainDeletes an app service account specified by ID

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
idstringID of an existing service account
subdomainstring(default: my-org)
afterstringThe 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.
limitintegerA limit on the number of objects to return
matchstringSearches for app service accounts where the account name (name), username (username), app instance label (containerInstanceName), or OIN app key name (containerGlobalName) contains the given value

SELECT examples​

Retrieves an app service account specified by ID

SELECT
id,
name,
containerGlobalName,
containerInstanceName,
containerOrn,
created,
description,
lastUpdated,
ownerGroupIds,
ownerUserIds,
password,
status,
statusDetail,
username
FROM okta.privileged_access.service_accounts
WHERE id = '{{ id }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;

INSERT examples​

Creates a new app service account for managing an app account

INSERT INTO okta.privileged_access.service_accounts (
containerOrn,
description,
name,
ownerGroupIds,
ownerUserIds,
password,
username,
subdomain
)
SELECT
'{{ containerOrn }}' /* required */,
'{{ description }}',
'{{ name }}' /* required */,
'{{ ownerGroupIds }}',
'{{ ownerUserIds }}',
'{{ password }}' /* required */,
'{{ username }}' /* required */,
'{{ subdomain }}'
RETURNING
id,
name,
containerGlobalName,
containerInstanceName,
containerOrn,
created,
description,
lastUpdated,
ownerGroupIds,
ownerUserIds,
password,
status,
statusDetail,
username
;

UPDATE examples​

Updates an existing app service account specified by ID

UPDATE okta.privileged_access.service_accounts
SET
description = '{{ description }}',
name = '{{ name }}',
ownerGroupIds = '{{ ownerGroupIds }}',
ownerUserIds = '{{ ownerUserIds }}'
WHERE
id = '{{ id }}' --required
AND subdomain = '{{ subdomain }}' --required
RETURNING
id,
name,
containerGlobalName,
containerInstanceName,
containerOrn,
created,
description,
lastUpdated,
ownerGroupIds,
ownerUserIds,
password,
status,
statusDetail,
username;

DELETE examples​

Deletes an app service account specified by ID

DELETE FROM okta.privileged_access.service_accounts
WHERE id = '{{ id }}' --required
AND subdomain = '{{ subdomain }}' --required
;