Skip to main content

custom_domains

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

Overview

Namecustom_domains
TypeResource
Idokta.domains.custom_domains

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
domainsarrayEach element of the array defines an individual domain.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_custom_domainsselectsubdomainLists all verified custom domains for the org
get_custom_domainselectsubdomainRetrieves a custom domain by domainId
create_custom_domaininsertsubdomain, data__certificateSourceType, data__domainCreates your custom domain
replace_custom_domainreplacesubdomain, data__brandIdReplaces a custom domain's brand
delete_custom_domaindeletesubdomainDeletes a custom domain by domainId
upsert_certificateexecsubdomain, certificate, certificateChain, privateKey, typeUpserts (creates or renews) the MANUAL certificate for the custom domain

> Notes:
> * If the existing certificateSourceType is OKTA_MANAGED, this operation changes the source type to MANUAL. Okta no longer manages and renews certificates for this domain after you provide a user-managed certificate.
> * Okta supports TLS certificates and private keys that are PEM-encoded and 2048, 3072, or 4096 bits. See the Custom domain guide for more details.
verify_domainexecsubdomainVerifies the custom domain and validity of DNS records by domainId. Furthermore, if the certificateSourceType in the domain is OKTA_MANAGED, then an attempt is made to obtain and install a certificate. After a certificate is obtained and installed by Okta, Okta manages the certificate including certificate renewal.

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)

SELECT examples

Lists all verified custom domains for the org

SELECT
domains
FROM okta.domains.custom_domains
WHERE subdomain = '{{ subdomain }}' -- required;

INSERT examples

Creates your custom domain

INSERT INTO okta.domains.custom_domains (
data__certificateSourceType,
data__domain,
subdomain
)
SELECT
'{{ certificateSourceType }}' --required,
'{{ domain }}' --required,
'{{ subdomain }}'
RETURNING
id,
_links,
brandId,
certificateSourceType,
dnsRecords,
domain,
publicCertificate,
validationStatus
;

REPLACE examples

Replaces a custom domain's brand

REPLACE okta.domains.custom_domains
SET
data__brandId = '{{ brandId }}'
WHERE
subdomain = '{{ subdomain }}' --required
AND data__brandId = '{{ brandId }}' --required
RETURNING
id,
_links,
brandId,
certificateSourceType,
dnsRecords,
domain,
publicCertificate,
validationStatus;

DELETE examples

Deletes a custom domain by domainId

DELETE FROM okta.domains.custom_domains
WHERE subdomain = '{{ subdomain }}' --required;

Lifecycle Methods

Upserts (creates or renews) the MANUAL certificate for the custom domain

> Notes:
> * If the existing certificateSourceType is OKTA_MANAGED, this operation changes the source type to MANUAL. Okta no longer manages and renews certificates for this domain after you provide a user-managed certificate.
> * Okta supports TLS certificates and private keys that are PEM-encoded and 2048, 3072, or 4096 bits. See the Custom domain guide for more details.

EXEC okta.domains.custom_domains.upsert_certificate 
@subdomain='{{ subdomain }}' --required
@@json=
'{
"certificate": "{{ certificate }}",
"certificateChain": "{{ certificateChain }}",
"privateKey": "{{ privateKey }}",
"type": "{{ type }}"
}';