Trusted Origins for iFrame embedding
Trusted Origins lets you embed sites, like the Okta sign-in page or Okta-protected resources, in origins that you trust. This prevents your site from being embedded in an untrusted site. It's more secure than the iFrame Embedding option in Customizations, which lets you embed resources into any site.
See Frequently Asked Questions and Known Issues with Trusted Origins for iFrame Embedding.
How it works
Trusted Origins use the Content Security Policy's (CSP) frame-ancestors directive. Its frame-ancestors directive specifies parent pages that may embed a page using an iFrame. Trusted Origins lets you configure an origin that Okta returns in the frame-ancestors directive of the CSP header.
The user's browser determines whether the CSP frame-ancestors directive is enforced. iFrame Embedding is based on x-frame-options. Browsers that support the CSP frame-ancestors directive enforce it and give it precedence over x-frame-options. In the absence of CSP and x-frame-options, anyone can embed the resource into any site. When x-frame-options is set to SAMEORIGIN, the resource can only be displayed in a frame on the same origin as the page itself.
Disabling this feature may break existing iFrames. Verify that your iFrames are working properly by visiting the page that embeds Okta sign-in pages or Okta-resources in an iFrame.
For developer documentation, see Trusted Origins API.
Before you begin
Trusted Origins for iFrame embedding works only when the iFrame embedding under Customizations option, if you have enabled it. This ensures that your existing iFrames aren't unintentionally broken.
isn't in use. Okta recommends that you first embed all Trusted Origins you need and then turn off theStart this procedure
You can either create a new Trusted Origin or migrate an existing iFrame to Trusted Origins:
Embed the Okta sign-in page or resource in an iFrame
Embed the Okta End-User Dashboard in an iFrame
Migrate from Customizations iFrame to Trusted Origins
Embed the Okta sign-in page or resource in an iFrame
These instructions are for embedding the Okta sign-in page or Okta-protected resources in an iFrame using Trusted Origins. If you're migrating an existing iFrame from Customizations to Trusted Origins, see Migrate from Customizations iFrame to Trusted Origins.
-
In the Admin Console, go to .
-
Click Add Origin.
-
Enter the Origin Name and Origin URL in the respective fields.
-
Select the origin type as iFrame embed (origin). This keeps frame-ancestors in report-only if you enabled iFrame embedding in Customizations.
- Disable iFrame embedding in Customizations using either of these methods:
- Click the iFrame embedding link that appears in the warning message in the Admin Console.
- Go to Enable iFrame embedding. , and then clear
-
In the Add Origin dialog, click Save.
Embed the Okta End-User Dashboard in an iFrame
-
Follow steps 1 to 5 in Embed the Okta sign-in page or resource in an iFrame.
-
In the Add Origin dialog, select the Allows iFrame embedding of the Okta End-User Dashboard option.
-
Click Save.
Migrate from Customizations iFrame to Trusted Origins
- Go to and identify all iFrames.
- Configure these iFrames using Trusted Origins as described in Embed the Okta sign-in page or resource in an iFrame.
Don't disable iFrame embedding in Customizations yet. This keeps frame-ancestors in report-only so you can confirm that the new iFrame is working as expected before making it live.
- Check for any origins that you might have missed. Manually check the resources that you've embedded through Okta for CSP violations in the browser.
- Correct any CSP violations and ensure that all Trusted Origins are working correctly.
- Go to and clear iFrame embedding. Trusted Origins are now live.