本文介绍了如何防止直接访问Azure应用服务中托管的API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个托管在Azure应用服务中的后端API.我想将Azure API管理用作此后端API的前端,并已在Azure中成功配置了该API.我已将API管理配置为在访问此后端API时使用OAuth,当客户端通过Azure API管理终结点访问API时,该API可以工作,但是如何防止人们直接访问后端API终结点,以便仅从API管理终结点进行调用允许吗?

I have a backend API that is hosted in Azure app service. I want to use Azure API management as the front end to this backend API and have successfully configured this in Azure. I have configured API management to use OAuth when accessing this backend API which works when clients access the API through the Azure API management endpoints, but how do I prevent people from accessing the backend API endpoints directly so that only calls from the API management endpoints are allowed?

推荐答案

有几种不同级别的安全性选项:

There are a few options of various levels of security:

  1. 共享机密-在APIM中设置具有特定值的特定标头,然后在您的后端检查该值.
  2. IP过滤器-检查APIM IP作为后端的源.
  3. 客户端证书身份验证-将客户端证书身份验证上传到APIM,并将其附加到每个后端请求.在后端检查该证书.
  4. VNET-将APIM和您的后端放入同一个VNET中,并阻止从外部到后端的访问.

这篇关于如何防止直接访问Azure应用服务中托管的API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 22:54