简体   繁体   English

使用Azure API管理重定向到URL

[英]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.

相关问题 Azure API - Unable to access API gateway Url from API Management - Azure API - Unable to access API gateway Url from API Management 用于注销的页面重定向不适用于委托身份验证(Azure API管理) - Page redirect for logout not working with delegated authentication (Azure API Management) 使用AzureWebJob中的Azure管理API - Using Azure Management API from AzureWebJob 使用 Microsoft.Azure.Management.ApiManagement 以编程方式将 API 导入 Azure API 管理 (APIM) - Import APIs to Azure API Management (APIM) progrmatically using Microsoft.Azure.Management.ApiManagement 使用AD与Azure Management API一起使用时出错 - Error when using AD to work with Azure Management API How do I get .NET redirects to work with an API deployed to an Azure API Management Service with a URL suffix? - How do I get .NET redirects to work with an API deployed to an Azure API Management Service with a URL suffix? Azure管理API中的身份验证问题 - Authentication Issue in Azure Management API 401 未经授权的 Azure 管理 API - 401 unauthorized Azure management api .Net的Azure服务管理API - Azure Service Management API for .Net 使用REST API或Azure管理库在SQL Azure数据库上执行存储过程 - Executing stored procedures on SQL Azure database using REST API or Azure Management Libraries
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM