Origin Whitelisting (CORS)
Origin whitelisting — labelled URL White Listing (CORS) in the Developer Portal — controls which websites are allowed to host your ChainIT integration. It prevents unauthorized domains from embedding your OAuth flow or making API calls using your clientId.
Every IDP and Hosted UI application must register at least one allowed origin.
Requests from origins not on the list are rejected with a 401 Unauthorized
or a CORS error.
Configuration
Configure allowed origins in the Developer Portal under URL White Listing (CORS) when creating or editing an application.
https://app.example.com
https://staging.example.com
https://app.example.com
http://localhost:3000
Rules
| Rule | Example | Supported? |
|---|---|---|
| Full origin (protocol + host + port) | https://app.example.com | ✅ |
| Subdomain wildcard (Hosted UI only) | https://*.example.com | ✅ |
| Localhost with port | http://localhost:5173 | ✅ |
Bare * (any origin) | * | ❌ Rejected |
| Path or trailing slash | https://app.example.com/path | ❌ Strip paths |
Important notes
- Protocol matters:
https://app.comandhttp://app.comare different origins. List both if needed. - Port matters:
http://localhost:5173andhttp://localhost:3000are different origins. - Trailing slashes: Stripped automatically — do not add them.
- Subdomain wildcards (Hosted UI only):
https://*.example.commatcheshttps://app.example.comandhttps://staging.example.com, but nothttps://example.com(the bare domain without a subdomain). Wildcards are only honored for Hosted UI applications — IDP applications require exact-origin matches. - No paths: Origins are protocol + host + port only. Paths after the origin are ignored.
- One per line: Enter each origin on its own line in the text area.
Best practices
1. List every environment
Add origins for every environment your application runs in:
- Production:
https://app.example.com - Staging:
https://staging.example.com - Development:
http://localhost:5173 - Preview / PR deployments:
https://preview-123.example.com
2. Never use a bare *
Wildcard origins defeat the purpose of whitelisting. The portal rejects * to prevent accidental misconfiguration.
3. Prefer subdomain wildcards for previews (Hosted UI only)
For Hosted UI applications, if your deployment model uses ephemeral subdomains (https://pr-42.app.example.com), use https://*.app.example.com instead of listing each one individually. IDP applications do not support wildcards — list each preview origin explicitly.
4. Audit regularly
Review your origin list periodically. Remove stale origins (decommissioned environments, old preview URLs) to reduce attack surface.
5. Match redirect URIs
For IDP applications, ensure that the redirect_uri parameter in your authorize request resolves to an origin on the whitelist. While redirect URIs and allowed origins are separate validations, mismatches cause opaque failures.
Troubleshooting
CORS error in the browser console
If you see a CORS error in the browser's developer console when calling the token or userinfo endpoint:
- Confirm the origin (
window.location.origin) is listed in URL White Listing (CORS) for your application. - Check for protocol/port mismatches —
https://vshttp://, or a different port number. - Verify the entry has no trailing slash or path.
Hosted UI shows "Origin is not allowed"
The SDK's first browser-side call checked the X-Origin header against your whitelist and the origin was not found.
- Open the application in the Developer Portal and verify the origins under URL White Listing (CORS).
- Check that the whitelisted origin matches
window.location.originexactly — protocol, host, and port. - If using a staging or local environment, make sure that specific origin was added.