Allowing CORS from a Foreign Domain - Allowing CORS from a Foreign Domain - OnBase - Public Sector Constituency Web Access - OnBase/Public-Sector-Constituency-Web-Access/Foundation-23.1/Public-Sector-Constituency-Web-Access/Configuration/API-Configuration/Cross-Origin-Resource-Sharing-CORS/Allowing-CORS-from-a-Foreign-Domain - Foundation 23.1 - Foundation 23.1

Public Sector Constituency Web Access

Platform
OnBase
Product
Public Sector Constituency Web Access
Release
Foundation 23.1
License
ft:lastPublication
2025-04-01T14:42:19.727000
ft:locale
en-US

The following configuration is required if the front-end client files are hosted on a different machine or host than the API, even if the only change is a domain name or port.

To allow for the API to be accessed from one external domain, the domain your front-end is hosted on, change the value of the Access-Control-Allow-Origin attribute to the exact hostname (including protocol, such as https).

The following example shows how to configure CORS with http://www.example.com as the allowed foreign domain which hosts the front-end client.

<httpProtocol>
<customHeaders>
<!-- Comma-separated list of origins that are allowed to make requests to this API. Enables cross-origin resource sharing (CORS) to these hosts. -->
<add name="Access-Control-Allow-Origin" value="http://www.example.com" />
<add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept" />
</customHeaders>
</httpProtocol>