简体   繁体   English

在Azure Api管理中保护WebApi

[英]Securing WebApi in Azure Api Management

I have deployed my webapi on Azure Websites and exposing it through Azure Api Management Portal. 我已经在Azure网站上部署了我的webapi,并通过Azure Api管理门户公开它。 I want to block access on azurewebsites url so that a user can only access my api through azure aoi management proxy through security key. 我想阻止访问azurewebsites url,以便用户只能通过安全密钥通过azure aoi管理代理访问我的api。 Can you please shed some light on how can this be done. 能否请您详细说明如何做到这一点。 I have heard Mutual Certificates can be used but not finding any article online which describes the process of creating such certificates and configuring web api to effectively use them. 我听说过可以使用相互证书,但没有在网上找到任何描述创建此类证书和配置web api以有效使用它们的过程的文章。 My Second question is , Is there a mechanism to get Api Primary key based on UserName / Password and Product name. 我的第二个问题是,是否有基于UserName / Password和Product name获取Api主键的机制。 What would be the best approach regarding keep that api access key. 保持api访问密钥的最佳方法是什么? Should client app store it in some config file and this should be obtained programatically at run time? 客户端应该将它存储在某个配置文件中,这应该在运行时以编程方式获取吗?

Many thanks 非常感谢

There are multiple ways to protect your backend: 有多种方法可以保护您的后端:

  1. Use basic authentication 使用基本身份验证
  2. Use mutual cert authentication https://azure.microsoft.com/en-us/documentation/articles/api-management-howto-mutual-certificates 使用相互认证身份验证https://azure.microsoft.com/en-us/documentation/articles/api-management-howto-mutual-certificates
  3. IP-whitelisting. IP-白名单。 If you have a standard or premium instance, the IP address of the proxy will stay the same. 如果您有标准或高级实例,则代理的IP地址将保持不变。
  4. Use OAuth. 使用OAuth。 An example can be found here: https://channel9.msdn.com/Blogs/AzureApiMgmt/Protecting-Web-API-Backend-with-Azure-Active-Directory-and-API-Management Hope that helps. 可以在这里找到一个例子: https//channel9.msdn.com/Blogs/AzureApiMgmt/Protecting-Web-API-Backend-with-Azure-Active-Directory-and-API-Management希望有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM