如何在Azure中为Microsoft Teams机器人添加授权

huangapple go评论69阅读模式
英文:

How to add authorization to Microsoft Teams Bot in Azure

问题

我在Azure中托管了一个正常运行的机器人,但我想通过Azure Active Directory添加授权。

我已经将oauth2AllowIdTokenImplicitFlow和oauth2AllowImplicitFlow设置为true,并在授权下勾选了ID-Token。

但是当我访问我的托管机器人的URL时,仍然收到以下消息:

AADSTS700054:应用程序未启用'response_type'为'id_token'的响应类型。

是否有更好的授权方法,还是我漏掉了什么?

提前感谢!

英文:

I hosted a Bot in Azure that works as intended, but I wanted to add authorization via Azure Active Directory.
I already set oauth2AllowIdTokenImplicitFlow and oauth2AllowImplicitFlow to true and checked ID-Token under authorization.

But when I go to my hosted Bots Url I still get this message:

AADSTS700054: response_type 'id_token' is not enabled for the application.

Are there better ways for authorization or am I missing something?

Thanks in advance!

答案1

得分: 1

我不完全清楚你所说的关于“连接到SharePoint”的意思 - 你是指机器人调用这些产品,使用应用凭据,这就是为什么你想要对用户进行身份验证吗?如果是这样,你应该查看Teams文档中的机器人身份验证流程

基本上,它涉及发送一种特殊类型的“卡片”响应(如果你没有发送卡片,这意味着你不是发送文本消息给用户,而是在聊天窗口内发送一种“迷你表单”)。有关卡片的更多信息,请参阅这里,但具体在文档后面有关你所需的卡片的部分,即登录卡片

第一篇文章链接到第二篇文章,其中包含更详细的逐步说明,以及获取访问令牌的步骤,以及示例项目的链接。请查看向Teams机器人添加身份验证

希望对你有所帮助。

英文:

I'm not totally clear what you mean about "connected to SharePoint.." - do you mean the Bot calls into those products, using, say, app credentials, and that's why you want to authenticate the user? If so, you should have a look at Authentication flow for Bots as part of the Teams documentation.

Essentially, it involves sending a special kind of "card" response (if you've not send a Card, it means that, instead of sending a text message to the user, you're sending a kind of "mini form" inside the chat window). There's more on cards here, but specifically later on in the doc is a part about the card you need, the signin card.

The first article links to a second one with more detailed step-by-step instructions on getting it up and running, and getting the access token, as well as a link to a sample project. See Add authentication to your Teams bot.

Hope that helps.

huangapple
  • 本文由 发表于 2020年1月6日 19:20:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/59611188.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定