【发布时间】:2017-04-05 09:06:44
【问题描述】:
我在对 S4BO 进行身份验证时遇到问题。我已经注册了我的应用程序(在 azure 门户中),它与https://ucwa.skype.com/websdk 的 webSDK 演示一起正常工作 我遵循的过程如下:
-
我使用以下代码执行 OAuth 链接重定向:
https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&resource=https://webdir.online.lync.com&redirect_uri=http://myurl.dev/skype -
获取已经返回的授权码,并使用它生成访问令牌:
POST https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=db01d1f5-f2a3-4d82-b4bc-6b3b4071d7df&resource=https://webdir.online.lync.com&redirect_uri=http://acme.intranet.dev/skype grant_type=authorization_code code=$thecodehere client_id=$clientidhere client_secret=$clientsecrethere redirect_uri=$sameuriasbefore -
在此之后,我有了访问令牌。现在我需要我的用户网址。所以我会自动发现
GET https://lyncdiscover.mydomain.onmicrosoft.com
我收到类似的结果:
{
"_links": {
"self": {
"href": "https://webdir1e.online.lync.com/Autodiscover/AutodiscoverService.svc/root?originalDomain=mydomain.onmicrosoft.com"
},
"user": {
"href": "https://webdir1e.online.lync.com/Autodiscover/AutodiscoverService.svc/root/oauth/user?originalDomain=mydomain.onmicrosoft.com"
},
"xframe": {
"href": "https://webdir1e.online.lync.com/Autodiscover/XFrame/XFrame.html"
}
}
}
-
我尝试在用户 url 登录:
GET https://webdir1e.online.lync.com/Autodiscover/AutodiscoverService.svc/root/oauth/user?originalDomain=mydomain.onmicrosoft.com HEADERS: Authorization: Bearer + theAccessTokenFromAbove Referer: https://webdir1e.online.lync.com/Autodiscover/XFrame/XFrame.html
在此之后我得到 403 Unathorized。我哪里错了?
【问题讨论】:
-
它比你上面的更复杂。您拥有用户对 O365 的访问令牌。然后,您需要使用这些凭据登录 Skype for Business Online,最后获得 UCWA 可以用来通过自动发现获得授权的 oauth 令牌。
-
你能告诉我或指向一个资源来展示如何做到这一点吗?我一辈子都无法从他们拥有的文档中弄清楚。
-
具体来说,我不确定如何在我的 Web 应用程序服务器应该能够代表用户安排会议的情况下执行此操作,即使用户未登录到站点(所以当用户不在我的网站上时我应该可以访问)。
标签: skype-for-business skypedeveloper ucwa