Conditionally support credentials based on origin. A good Idea?

35 Views Asked by At

So this question is not really related to flask but a question in general about CORS. I happen to be using flask api though. I want to conditionally support_credentials to my endpoint if the origin of the request is from some specific domains...otherwise reject credentials.

I was surprised that this did not seem to be supported in flask under the hood. I have been trying to find similar use cases online but its hard to find this. So I am now wondering if what I want to do is a good idea or not. Perhaps for such a scenario there are other recommended ways?

Basically my endpoint is shared among multiple origins and I want to give some origins more privileges, as regards sending cookies to the endpoint, than others.

0

There are 0 best solutions below