Access to API through Azure API Management without setting Ocp-Apim-Subscription-Key

我是研究僧i 提交于 2019-12-08 08:39:28

问题


Is there a way to create a API which does not require the caller to pass in the Ocp-Apim-Subscription-Key without having to create a separate product and un-checking the Require subscription checkbox. What I want is within the same product to have some APIs which require the Ocp-Apim-Subscription-Key to be passed in and some APIs which can be called without passing the Ocp-Apim-Subscription-Key in the request header.


回答1:


We cannot achieve it without un-checking the Require subscription checkbox.

I have been working around APIM these days, and as per my understanding we need to create a new Product, which doesnot require subscription.

And Ideally we should write some throttling policies to all open products. Lower rate limit for guest, and higher limit for the users with subscription key.




回答2:


I'm afraid a product is either bound to a subscription or not. You cannot mix both into the same product.

That being said, it is possible to implement a similar "subscription key" within your APIM policy for example. But, obviously, you would need to custom build it yourself.



来源:https://stackoverflow.com/questions/46895768/access-to-api-through-azure-api-management-without-setting-ocp-apim-subscription

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