如何使用经带有承载令牌的Azure AD授权的服务 [英] how to use services that are authorised with Azure AD with bearer tokens

查看:89
本文介绍了如何使用经带有承载令牌的Azure AD授权的服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用一项服务,该服务可以从我的机器人内部授权带有Bearer令牌(Azure AD令牌)的请求. 我该如何处理这种情况.

I am trying to use a service that authorizes requests with Bearer token (Azure AD token) from within my bot. How do I handle such a scenario.

推荐答案

基本上,策略是创建一个支持您的身份验证的网页并将链接发送给用户.当他们单击它时,他们将通过身份验证流程,当您获得访问令牌时,您将通过api将其保存到该用户的BotData中,然后将新消息发布回对话中.

Basically the strategy is to have a web page which supports your auth and send a link to the user. When they click on it, they will go through the auth flow and when you get the access token you save it into the BotData for the user via api, and then post a new message back to the conversation.

此后,漫游器可以访问存储在botdata结构中的访问令牌,并且可以使用该令牌直到到期为止.

After that, the bot has access to the access token stored in the botdata structure and can use that until it expires.

这篇关于如何使用经带有承载令牌的Azure AD授权的服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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