[英]Using azure API management to redirect to a URL
I have an azure function that performs a redirect to a login journey and I want to know if it is possible to protect this function with the API management tool. 我有一个执行重定向到登录过程的azure函数,我想知道是否可以使用API管理工具来保护此函数。 I am able to redirect to the azure function's URL and everything works nicely but because the API Management service requires a subscription key I can not do a simple redirect to the URL as this loses any headers.
我能够重定向到azure函数的URL,并且一切正常,但是因为API管理服务需要订阅密钥,所以我无法简单地重定向到URL,因为这会丢失任何标头。
var responseMessage = new HttpResponseMessage(HttpStatusCode.Redirect);
responseMessage.Headers.Location = new Uri(redirectUri);
return responseMessage;
This is currently all the azure function is doing to try and give some context so can API management do this for me or is it simply not possible? 目前,azure函数正在尝试尝试提供一些上下文,因此API管理可以为我做到这一点,还是根本不可能?
If all you want is to put APIM in front of the function and you don't want to manage APIM subscription keys, you could create new open product ( https://docs.microsoft.com/en-us/azure/api-management/api-management-key-concepts#a-nameproducts-a-products ), add your API to that product and mark it as published. 如果您只想将APIM放在函数的前面,并且不想管理APIM订阅密钥,则可以创建新的开放产品( https://docs.microsoft.com/zh-cn/azure/api-管理/ api-management-key-concepts#a-nameproducts-a-products ),将您的API添加到该产品并将其标记为已发布。 Once any API is added to an open product it becomes possible to call that API without providing subscription key.
一旦将任何API添加到开放产品中,就可以在不提供订阅密钥的情况下调用该API。 It's effectively becomes anonymous API since APIM will not be able to identify users making calls.
由于APIM无法识别进行呼叫的用户,因此它实际上已成为匿名API。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.