跨多个Logic应用在Logic中重用API令牌 [英] Reusing API token in Logic across multiple Logic Apps

查看:166
本文介绍了跨多个Logic应用在Logic中重用API令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须从Logic App中调用多个API端点,我首先从Token-API服务器获取承载令牌,然后将相同的令牌与Logic App中的其余API调用一起重用.我在每个Logic App中都遵循相同的模式.

最近,API开发人员团队坚持认为,我应该在所有Logic Apps中重用令牌,并且仅当从API服务器返回401时才获取新令牌.

请有人告诉我如何在Logic Apps的多个实例中使用同一令牌吗?我是否应该使用专用的预定逻辑来获取令牌并存储在Key-Vault中,并更新我的Logic Apps以从Key-Vault中获取令牌?

在生产环境中使用Bearer是否被认为是不好的做法?

亲切的问候

SS


Shiva Sadayan

解决方案

嘿,所以您有正确的主意.您可以通过将一个令牌存储在Key Vault中并按计划进行刷新来合并无记名令牌请求的数量,这样就不必像您建议的那样处理401或其他相关错误.

但是,由于Logic App没有预先构建的Key Vault连接器,因此您需要创建一个自定义API,Logic App可以使用该API来获取令牌.

关于不好的做法,我会说不,不是.微软的AAD(Azure Active Directory)实际上使用了承载令牌.最重要的是保护将在Key Vault中执行的令牌.


I’m having to call multiple API endpoints from a Logic App, I start with fetching a bearer token from a Token-API server and then reuse the same token with the rest of the API calls in the Logic App. I follow the same pattern in every Logic App.

Recently, the API dev team insisted that I should reuse the token across all the Logic Apps and only fetch a new Token when 401 is returned from the API server.

Please could someone advise me how to use the same token across multiple instances of Logic Apps? Shall I use a dedicated scheduled Logic to fetch Token and store in Key-Vault, and update my Logic Apps to fetch the Token from the Key-Vault?

Is using Bearer in production environment considered as a bad practise?

Kind Regards

SS  


Shiva Sadayan

解决方案

Hey, so you have the right idea. You could consolidate the number of Bearer Token requests by storing the one token in Key Vault and refreshing it on a schedule so you don't have to deal with 401 or other related errors--like you proposed. 

However, since Logic App doesn't have a pre-built Key Vault connector, you would need to create a custom API that the Logic Apps can use for fetching the token.

Regarding if it's a bad practice, I would say no, it's not. Microsoft's AAD (Azure Active Directory) actually uses Bearer Tokens. The most important thing is securing the token which you'll be doing in Key Vault.


这篇关于跨多个Logic应用在Logic中重用API令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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