使后端 API 只能通过 Azure API 管理访问 [英] Make back end APIs only accessible via Azure API management

查看:19
本文介绍了使后端 API 只能通过 Azure API 管理访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Azure 中部署了多个 Web API,但未应用身份验证,因此任何可以访问 Internet 的人都可以访问 Web API.

I have multiple Web APIs deployed in Azure without applying authentication, so anyone has access to internet has the access to the Web APIs.

现在我想对 Web API 应用身份验证,而不是在不同的 Web API 中实现相同的身份验证逻辑,我发现 Azure API 网关(API 管理)是一个潜在的解决方案.

Now I would like to apply authentications to the Web APIs, instead of implementing the same authentication logic in different Web APIs, I found Azure API gateway (API management) is a potential solution.

通过 Azure API 管理文档,我了解到我可以应用诸如 validate-jwt 之类的策略来对后端 Web API 的请求进行身份验证.但是,用户仍然可以使用后端 Web API 的端点.

With Azure API management documentation, I learned I can apply policies like validate-jwt to authenticate requests to back end Web APIs. However, endpoints of the back end Web APIs are still available to users.

那么,我应该如何隐藏它们?我必须定义一个子网络还是 Azure API 管理有这方面的功能?

So, how should I hide them? Must I define a sub network or does Azure API management have a feature for this?

推荐答案

最近我也遇到了同样的问题.最后我通过使用IP Restrictions"功能找到了解决方案.请参阅以下步骤:

Recently I also had this same problem. Finally I found the solution by using 'IP Restrictions' function. See the following steps:

1) 转到 Azure 门户中的 API 管理概览页面,复制 VIP.

1) Go to your API management Overview page in Azure portal, copy the VIP.

2) 在您的 Web 应用程序中 > 网络

2) In your Web APP > Networking

3) 粘贴到您的 VIP 中

3) Paste in your VIP

这篇关于使后端 API 只能通过 Azure API 管理访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆