How do I add an NSP analytics server to the allowlist for OSS report requests?

Purpose

When an OSS embeds reports from NSP Analytics in its own OSS web application, requests to retrieve these reports may be identified as cross-origin requests. Such requests are blocked by the NSP CORS policy, as only the hosts in the allowlist are accepted as NSP clients. Perform this procedure to disable the blocking of report retrieval by an OSS.

Steps
 

Log in as the nsp user on the primary NSP cluster host.


Open a console window.


Enter the following to acquire an access token from the REST API Gateway:

bash$ curl --insecure -X POST https://address/rest-gateway/rest/api/v1/auth/token -H 'authorization: Basic credentials' -H 'cache-control: no-cache' -H 'content-type: application/x-www-form-urlencoded' -d grant_type=client_credentials ↵

where

address is the advertised address of the NSP cluster

credentials is the base64-encoded credential set, expressed as username:password

The REST API Gateway returns an access token.


Enter the following once for each NSP analytics server to add the server as an allowlist target:

Note: You must add each NSP analytics server in the deployment to the allowlist.

bash$ curl -kv https://address/session-manager/api/v1/whitelist/allowedHosts -H 'Content-Type: application/json' -H "Authorization: Bearer access_token" --data '{"host":"allowlist_target"}' -X POST ↵

where

address is the advertised address of the NSP cluster

access_token is the access token returned in Step 3

allowlist_target is the hostname or IP address of the NSP analytics server

The NSP analytics server address is added to the allowlist.


Close the console window.

End of steps