Okta Account Chooser that leverages Web Messaging with hidden iframe to provide an account chooser across Okta organizations
Install package dependencies
npm install
- Add a DNS entry to your
/etc/hostsfile
127.0.0.1 login.okta.io
This project implements a root domain whitelist that only allows trusted callers. This is a security-best practice for cross-origin web messaging.
You can modify the whitelist by changing the following variables:
index.html
var iframeOrigin = 'https://login.okta.io:8080';discovery/iframe.html
var trustedRootDomains = ['okta.io:8080'];- Run
npm startto launch web server on https - Launch
https://login.okta.io:8080/test.htmland add an account - Launch
https://login.okta.io:8080and select account
You may get a certificate warning as the site uses non-trusted certificate authority for HTTPS
To run lint and unit tests:
[account-chooser-sample]$ npm test- Run
npm install - Run 'npm run build'
The build will output to the ./dist folder. Use this folder to publish.