0

現在のAngularJS WebアプリケーションにSkype for Businessを統合しようとしています。私はhttps://msdn.microsoft.com/en-us/library/office/mt622687(v = office.16).aspxの手順を踏んで、サインインできません。Skype for BusinessオンラインWeb SDK SignIn Lync Autodiscover Unauthorized

私のアプリは信じています私は以前、Outlook(O365)を同じ要件を持つアプリケーションに統合して以来、Azure ADに正しく登録されています。

だから、私は次の初期化を使用してadalAuthenticationServiceProvider経由でOffice 365のオンラインでユーザーを認証(マスクテナントの部分とのclientId下記の例):次に

var endpoints = { 
     'https://outlook.office365.com': 'https://outlook.office365.com', 
     'https://webdir.online.lync.com': 'https://webdir.online.lync.com' 
    }; 

    // Initialize the ADAL provider with your tenant name and clientID (found in the Azure Management Portal). 
    adalAuthenticationServiceProvider.init(
     { 
      tenant: 'xxxxxxxxxxxx1.onmicrosoft.com', 
      clientId: '8720xxxx-xxxx-xxxx-xxxx-xxxxe2a3a20c', 
      redirectUri: 'http://localhost/defaultDashboard', 
      postLogoutRedirectUri: 'http://localhost/defaultDashboard', 
      cacheLocation: 'localStorage', 
      anonymousEndpoints: ["/"], 
      endpoints: endpoints 
     }, 
     $httpProvider 
    ); 

は、私がのためのSkypeにサインインしよう

var config = { 
     apiKey: 'a42fcebd-5b43-4b89-a065-74450fb91255', // SDK 
     apiKeyCC: '9c967f6b-a846-4df2-b43d-5167e47d81e1' // SDK+UI 
    }; 

    Skype.initialize({ apiKey: config.apiKey }, function (api) { 
     var app = new api.application; 

     app.signInManager.state.changed(function (state) { 
      console.log("Login State: " + state); 
     }); 

     app.signInManager.signIn({ 
      "client_id": "8720xxxx-xxxx-xxxx-xxxx-xxxxe2a3a20c", //GUID obtained from Azure app registration. 
      "origins": ["https://webdir.online.lync.com/autodiscover/autodiscoverservice.svc/root"], 
      "cors": true, 
      "redirect_uri": 'http://localhost/defaultDashboard', // Can be any location in the current site. (Any valid Url) 
      "version": 'xxxxx/1.0.0.0' 
      }); 

     var resource = adalAuthenticationService.getResourceForEndpoint('localhost'); 
     var tokenStored = adalAuthenticationService.getCachedToken(resource); 

     if (tokenStored) { 
      var Bearercwt = 'Bearer cwt='; 
      var Bearer = 'Bearer '; 
      var cwt = 'cwt'; 

      if (tokenStored.indexOf(cwt) == -1) { 
       tokenStored = Bearercwt + tokenStored; 
      } 
      if (tokenStored.indexOf(Bearer) == -1) { 
       tokenStored = Bearer + tokenStored; 
      } 

      var options = { 
       auth: function (req, send) { 
        req.headers['Authorization'] = tokenStored.trim(); 
        return send(req); 
       }, 
       domain: 'localhost' 
      }; 

      app.signInManager.signIn(options).then(
       function() { 
        console.log('Signed in as ' + app.personsAndGroupsManager.mePerson.name()); 
       }, 
       function(err) { 
        console.log('Sign in failed: '+err); 
       }); 
     } 
    }, function (err) { 
     console.log("cannot load the sdk package", err.toString()); 
    }); 
:ビジネスオンライン私たちの adalAuthenticationService内に格納されたアズールADから受信したアクセストークンを使用して、ユーザーに署名しようとする試みが続きます

私は最初に開発文書が2つの別個のものを示唆しているのか不明であることに注意したいと思いますsignInManager.signInが呼び出されます。私の本当の問題は、最初のsignInコール(clientIdを使用)が「無効な資格情報」(以下を参照)のために拒否されたGETコールをトリガーすることです。その後

webdirca1.online.lync.com/Autodiscover/AutodiscoverService.svc/root/oauth/user : 401

、この同じコールは、この時点でエラー(下記参照)「サービスは、この原点からのクロスドメイン要求を許可しない」を返す、ループ内のすべて〜3秒の引き金ます。私が最初にサインイン呼び出しをコメントアウトし、AzureのAD認証から受信のみアクセストークンを使用してサインインしようとすると

webdirca1.online.lync.com/Autodiscover/AutodiscoverService.svc/root/oauth/user : 403

、私は、HTTPSからのエラーlyncdiscover 2ネット:: ERR_SSL_PROTOCOL_ERRORに直面しています: //lyncdiscoverinternal.localhost/xframeとhttps://lyncdiscover.localhost/xframe(以下を参照してください.PSドメインをlocalhostからAzure ADテナントに変更すると同じエラーが発生します)。

Skype for Business OnlineのWeb SDKアプリケーションを開発するための前提条件がありませんか?どんな助けも非常に高く評価されるでしょう。

+0

スカイプ用のSkype水SDKは、新しい(https://msdn.microsoft.com/en-us/library/office/mt622687(v=office.16).aspxビジネスオンラインの開発ドキュメントのリンクです2つ以上のリンクを残すことはできませんでした、申し訳ありません)。 – Mike

+0

Skype for Businessの前にADALを使用してログインしているのはなぜですか? signInManagerへの2回の呼び出しの理由は、(1)Azure ADへの認証と(2)これらの資格情報を使用してSkype for Businessに認証するという2つの問題を処理することです。 「http:// localhost/defaultDashboard」がサイト内の有効な場所に移動していることは確かですか? – ShelbyZ

+0

私はOffice 365 OutlookにアクセスするためにAzure ADへの認証にADALを使用しています(これは動作しています)。 signInManager call(1)を単に認証して資格情報を取得するだけであれば、技術的にはADAL認証から取得した資格情報をcall(2)に使用することができます。 yes「localhost/defaultDashboard」は有効な場所を指定します。「redirectUri」の下の「adalAuthenticationServiceProvider.init」関数でどのように使用しているかを確認し、適切な認証(ADAL経由)の際にリダイレクトします。 – Mike

答えて

0

ドメイン: 'localhost'を含むオプション付きの2番目のサインインは、前提条件の場合にのみスカイプとして使用する必要はありません。

変更されたコードを見つけてください。それはあなたのために働くかもしれません。ここで

var config = { 
    apiKey: 'a42fcebd-5b43-4b89-a065-74450fb91255', // SDK 
    apiKeyCC: '9c967f6b-a846-4df2-b43d-5167e47d81e1' // SDK+UI 
}; 

Skype.initialize({ apiKey: config.apiKey }, function (api) { 
    var app = new api.application; 

    app.signInManager.state.changed(function (state) { 
     console.log("Login State: " + state); 
    }); 


    var resource = adalAuthenticationService.getResourceForEndpoint('localhost'); 
    var tokenStored = adalAuthenticationService.getCachedToken(resource); 

    if (tokenStored) { 
     var Bearercwt = 'Bearer cwt='; 
     var Bearer = 'Bearer '; 
     var cwt = 'cwt'; 

     if (tokenStored.indexOf(cwt) == -1) { 
      tokenStored = Bearercwt + tokenStored; 
     } 
     if (tokenStored.indexOf(Bearer) == -1) { 
      tokenStored = Bearer + tokenStored; 
     } 

     var options = { 
      "client_id": "8720xxxx-xxxx-xxxx-xxxx-xxxxe2a3a20c", //GUID obtained from Azure app registration. 
      "origins": ["https://webdir.online.lync.com/autodiscover/autodiscoverservice.svc/root"], 
      "cors": true, 
      "redirect_uri": 'http://localhost/defaultDashboard', // Can be any location in the current site. (Any valid Url) 
      "version": 'xxxxx/1.0.0.0' 
     }; 

     app.signInManager.signIn(options).then(
      function() { 
       console.log('Signed in as ' + app.personsAndGroupsManager.mePerson.name()); 
      }, 
      function(err) { 
       console.log('Sign in failed: '+err); 
      }); 
    } 
}, function (err) { 
    console.log("cannot load the sdk package", err.toString()); 
}); 
関連する問題