0
votes

I have hosted my REST services on API management and consuming those in the Azure Web app service which consists of only HTML pages, javascript files and CSS files.

I would like to know how to restrict accessing the REST endpoints of the API management only from the web app without Azure AD and OAuth setup.

2
well, implement some sort of auth, say certificate auth?4c74356b41
Can you please elaborate?user2941236
I'm a bit confused at this point, so you have Api and a WebApp? those are 2 different things?4c74356b41
yes, i have REST API endpoints on API management and these endpoints should be accessible only from my web application which is hosted on Azure using Web app service.user2941236
should your website be accessible from the web?4c74356b41

2 Answers

1
votes

Client side application sources are by design available in clear text to anyone using it. Any user can open developer tools in browser and look at code you've written to make app work. So even if you secure your REST API with some secret and use it in app code to talk to that REST API anyone in the world will be able to take that secret our of the app and call your REST API directly, and you would have no way to distinguish their calls from calls made by your app.

OAuth and AAD would work to a certain extent but even they allow you to authenticate user, not the app. Same user can easily trace calls made by your app to REST API and reproduce them in any other app, and you again would have to way of figuring that out.

I think your best bet is to throttle calls made by a certain user identifying it any way you want (even if by IP address).

0
votes

You can use Certificate authentication from web app to api management. The ssl certficate thumbprint on you web app you can validate in api management policy.