我们应该使用什么范围来向Skype Bot发送消息 [英] What scope should we use to sent messages to skype bot

查看:125
本文介绍了我们应该使用什么范围来向Skype Bot发送消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 https://azure.microsoft.com/zh-CN/documentation/articles/active-directory-v2-protocols-oauth-code/,我能够生成访问令牌.但是,当我尝试使用使用上述url中定义的范围生成的访问令牌向Skype bot发送消息时,出现"401:提供的'OAuth'票证身份验证失败"的消息.错误.在生成代码或访问令牌以通过API向Skype bot发送消息时应使用什么范围( https://docs.botframework.com/en-us/skype/chat/#rest-api ).在skype/chat/#authentication下在此处指定的范围甚至都不需要我登录页面即可生成代码.

Using https://azure.microsoft.com/en-us/documentation/articles/active-directory-v2-protocols-oauth-code/, i was able to generate access token. But when i try to sent a message to skype bot using the access token generated using scopes defined in above url, i get a "401: The provided 'OAuth' ticket failed authentication." error. What scopes should i use while i generate a code or access token to sent a message to skype bot via API (https://docs.botframework.com/en-us/skype/chat/#rest-api ) . The scope specified here under skype/chat/#authentication does not even takes me to login page to generate code .

推荐答案

要生成令牌,您应该执行

To generate a token you should do the HTTP call described in https://api.botframework.com/en-us/skype/chat/#authentication, i.e.

POST /common/oauth2/v2.0/token HTTP/1.1 
Host: login.microsoftonline.com 
Content-Type: application/x-www-form-urlencoded

client_id=<your bot msa app id>&client_secret=<your bot secret>&grant_type=client_credentials&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default

因此范围为" https://graph.microsoft.com/.default "

这篇关于我们应该使用什么范围来向Skype Bot发送消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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