A technology sample that leverages Web Messaging with hidden iframe to provide an account chooser across domains
Install packages
npm install
This demo is currently coded to only allow requests from *.okta.io:8080 origins.
- Add 2 DNS entries to your
/etc/hostsfile
127.0.0.1 login.okta.io127.0.0.1 example.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 - Launch
https://login.okta.io:8080/test.htmland add an account - Launch
https://login.okta.io:8080and select account
To run lint and unit tests:
[account-chooser-sample]$ npm test