domain allowlist
kensyone
HOBBYOP

7 months ago

I’d like to know if there’s a way to configure a domain allowlist or restriction so that only requests from specific domains are allowed to access my app over HTTP

Solved$10 Bounty

Pinned Solution

janup2442
FREE

7 months ago

If you are using Nodejs server for your app , you can use CORS library (npm i cors). its Cross Origin Resource Sharing middleware , which only allow whitelisted domain to access and use you api or app .

configure it in , according your need . for e.g.
import cors from 'cors'
app.use(cors({

origin : ['array of allowed origin'],

credentials: true // true if you are using cookies in your site , by default its false

}))

1 Replies

brody
EMPLOYEE

7 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 7 months ago


janup2442
FREE

7 months ago

If you are using Nodejs server for your app , you can use CORS library (npm i cors). its Cross Origin Resource Sharing middleware , which only allow whitelisted domain to access and use you api or app .

configure it in , according your need . for e.g.
import cors from 'cors'
app.use(cors({

origin : ['array of allowed origin'],

credentials: true // true if you are using cookies in your site , by default its false

}))


Status changed to Solved brody 7 months ago


Loading...