为了确保仅由您的逻辑应用程序的授权政策接受有效令牌,请执行以下步骤:
1。逻辑应用中配置身份验证:使用逻辑应用中的身份验证选项来指定发行者和受众。发行人应设置为https:// login.microsoftonline.com // v2.0`,并且受众应为您的应用程序ID中的应用ID中的App Active Directory [1]中的应用程序ID。
2。包括授权标题:在逻辑应用程序代码视图中,添加
operationOptions'':“ IncludeAuthorizationHeaderSinOutputs”
触发''。这样可以确保JWT令牌包含在触发器的输出中[1]。
3。使用Azure Active Directory(AAD)进行令牌验证:在Azure AD中注册您的应用程序以获取客户ID和房客ID。使用这些来生成可以通过逻辑应用程序验证的访问令牌。如果您使用管理API,则确保令牌的受众与Azure Management Resources的受众之一相匹配[9]。
4.实施其他安全措施:考虑使用Azure API管理(APIM)添加额外的安全层,例如IP过滤,速率限制和缓存。 APIM还可以处理OAuth 2.0和Azure Active Directory身份验证,提供更强大的安全选项[2]。
5。验证令牌索赔:确保对您的逻辑应用程序的预期价值正确验证令牌索赔,例如受众和发行人。这可以通过检查令牌内容并确保它们与您的应用程序的配置匹配[7]来完成。
通过实施这些措施,您可以有效地确保只有逻辑应用程序的授权政策才能接受有效的令牌。
引用:
[1] https://autosysops.com/blog/parse-jwt-tokens-in-azure-logic-apps
[2] https://turbo360.com/blog/logic-app-best-practices-secure-your-azure-logic-apps
[3] https://techcommunity.microsoft.com/blog/integrationsonazureblog/authenticate-antenticate-antard-logic-anpic-apps-using-oauth-oauth-2-0-bearer-bearer-token/3269576
[4] https://shopify.dev/docs/apps/build/authentication-authorization/access-tokens/authorization-code-grant
[5] https://www.youtube.com/watch?v=zvijhve0muu
[6] https://auth0.com/blog/refresh-tokens-what-what-are-they-and-when-when to-use-them/
[7] https://www.linkedin.com/pulse/securing-request-- trignd-logic-apps-usis-usis-azure-senih
[8] https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-securing-a-logic-app
[9] https://stackoverflow.com/questions/75551840/invalidauthenticationtokenaudience-authentication-for-logic-apps