Azure API Apps with AllowAnonymous

坚强是说给别人听的谎言 提交于 2019-12-08 14:40:05

问题


With an Azure API App, is there a way to have a mix of authentication levels for different endpoints in the underlying Web API?

I want the API App to have access level of 'Public (authenticated)' but one of the endpoints needs to be accessible as an anonymous user. Previously I would have just applied the AllowAnonymous attribute on the method, but the gateway still intercepts and returns an unauthenticated response.

The only other thing I can think of is to set the API App to 'Public (anonymous)' and then use the usual Authorize attribute on the Web API, but not entirely sure how this would play out with the Gateway handling authentication in the Azure App Service model.


回答1:


Unfortunately, there isn't a way to do this today, unless you handle the authentication yourself, just like you described.

You'll still get all the benefits of App Service and Swagger but just not the Authentication on the Gateway.

This is a good suggestion to track, please post your ideas at our Uservoice feedback forum



来源:https://stackoverflow.com/questions/31515199/azure-api-apps-with-allowanonymous

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!