我正嘗試使用Skype for business web SDK創建應用程序。Skype for business web sdk 401嘗試登錄時未經授權
這裏是登錄代碼的一部分:
var config = {
apiKey: 'a42fcebd-5b43-4b89-a065-74450fb91255', // SDK
apiKeyCC: '9c967f6b-a846-4df2-b43d-5167e47d81e1' // SDK+UI
};
var Skype;
var app;
console.log(Skype);
Skype.initialize({ apiKey: config.apiKey }, function(api) {
window.skypeWebAppCtor = api.application;
window.skypeWebApp = new api.application();
Application = api.application;
app = new Application();
console.log("app", app);
skypeSignIn();
window.skypeWebApp.signInManager.state.changed(function(state) {
console.log("in",state);
});
}, function(err) {
console.log(err);
console.log("cannot load the SDK");
});
var skypeSignIn = function() {
app.signInManager.signIn({
"client_id": "my-GUID", // GUID obtained from Azure app registration.
"origins": ["https://webdir.online.lync.com/autodiscover/autodiscoverservice.svc/root"],
"cors": true,
"redirect_uri": 'https://freshservice.com',
"version": 'freshservice skype for business integration'
}).then(function() {
alert('Logged in!');
});
當我嘗試了上面的代碼提供了有關源URL錯誤401 -
GET https://webdirin1.online.lync.com/Autodiscover/AutodiscoverService.svc/root/oauth/user 401 (Unauthorized)
如何這個問題能解決?
這個訪問令牌應該用在哪裏?我找不到使用訪問令牌的任何參考。 –
@SoorajChandran您不必擔心使用訪問令牌。 Skype Web SDK負責管理它,並自動爲每個請求附加訪問令牌。 – Shahzad
我們能夠通過SDK登錄用戶。然而,我們正在嘗試使用訪問令牌來做同樣的事情,以便令牌可以持久化,並且用戶不必每次都登錄。這是可以實現的嗎? –