CONFIGURING


Configuring cross-origin resource sharing (CORS)

Configure cross-origin resource sharing (CORS) to allow a web application from another origin to access resources on a Domino web server.

About this task

For security reasons, most browsers comply with the same-origin policy rule. This rule restricts a web page loaded from one origin from accessing resources on a different server (or origin). CORS allows you to define exceptions to the same-origin policy. Most browsers support CORS.

Note:


For example, assume a web application loaded from Server A (an Apache server) makes REST API requests to Server B (a Domino server). Configure CORS on Server B to allow a web page loaded from Server A to make REST API requests to Server B.

CORS works for Domino Access Services (DAS) APIs and other kinds of REST APIs hosted on Domino. Indeed, CORS works for any type of Domino HTTP resource.

Complete the following steps to configure CORS on a Domino server.

Procedure

1. Enable CORS in the Server document of the Domino server:

2. Create a JSON file that defines the origins that can access the Domino server:
3. Stop and restart the HTTP server task:
Results

The following message at HTTP server startup means that CORS is correctly configured:

HTTP Server: DSAPI CORS Filter Loaded successfully

The following message at HTTP server startup means that there is a problem with the CORS configuration:

HTTP Server: Failed to load DSAPI module ncorsext