Reputation: 197
I have web api hosted on api.domain.com and my app is in app1.domain.com and app2.domain.com
I want to allow api.domain.com should be accessed only from app1.domain.com and app2.domain.com
how to achieve this? I have tried with allow access control but i don't want to show the allowed domain's in browser cosole
and also when i access api.domain.com through browser should show 403 - Forbidden: Access is denied.
Please help
Upvotes: 0
Views: 4764
Reputation: 7812
You can use IP and Domain restrictions features of IIS. This feature needs to be installed explicitly.
Upvotes: 0
Reputation: 499
More specifically to my comment above. You have to enable CORS support for the api endpoint controller.
[EnableCors(origins: "https://app1.domain.com,https://app2.domain.com")]
attribute on the controller.Upvotes: 1