[英]Access Azure APIM only via Trusted Android, iOS & Web Apps
We have Android, iOS and Azure Web app for our system which will be calling Azure APIM which is created for Azure API APP.我们的系统有 Android、iOS 和 Azure Web 应用程序,它们将调用为 Azure API APP 创建的 Azure APIM。
Problem statement is : APIM should only be accessible via Android, iOS and Azure Web app, for other clients like postman or any different mobile app or web app, APIM should give access denied
error.问题陈述是: APIM 应该只能通过 Android、iOS 和 Azure Web 应用程序访问,对于邮递员或任何不同的移动应用程序或 Web 应用程序等其他客户端,APIM 应该给出
access denied
错误。 We need a solution where header should not be passed from any of our trusted clients as this can be exploited and APIs can be called via third party clients like postman etc.我们需要一个解决方案,其中不应从任何受信任的客户端传递标头,因为这可以被利用,并且可以通过邮递员等第三方客户端调用 API。
There is not much you can do from web and end user devices.您可以通过 Web 和最终用户设备做很多事情。 In web apps you can't safely authenticate client app, since traffic and all secrets you may want to use are visible to a user.
在 Web 应用程序中,您无法安全地对客户端应用程序进行身份验证,因为用户可以看到您可能想要使用的流量和所有机密。 It's a bit more safe in Android and iOS, but event there phone may be rooted or jailbroken.
它在 Android 和 iOS 中更安全一些,但在那里手机可能已植根或越狱。
So I'd advise against relying on app secret, rather think about authentication user itself.因此,我建议不要依赖应用程序机密,而应考虑身份验证用户本身。 Much like any other web app works where user obtains a token and uses that token to access API.
就像任何其他网络应用程序一样,用户获取令牌并使用该令牌访问 API。 Since it's a user level token it's safe to expose it to a user.
由于它是用户级别的令牌,因此将其公开给用户是安全的。 Look into OAuth.
查看 OAuth。 If you want to use JWT tokens APIM has validate-jwt policy to check them.
如果你想使用 JWT 令牌 APIM 有 validate-jwt 策略来检查它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.