2017-04-05 151 views
1

我無法通過S4BO進行身份驗證。我已經註冊了我的應用程序(在蔚藍的門戶)和它在https://ucwa.skype.com/websdk 過程工作correclty與webSDK演示中,我所遵循的是以下之一:無法通過Skype For Business Online進行身份驗證UCWA

  1. 我做了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 
    
  2. 獲取已返回的授權碼,並用它來生成一個訪問令牌:

    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 
    
  3. 之後,我有我的訪問令牌。現在我需要我的用戶網址。所以我做自動發現

    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無理由。我哪裏錯了?

    +0

    它比你所擁有的上述比較複雜。你有一個用戶訪問令牌O365。然後,您需要使用這些憑據登錄到Skype for Business Online,最後獲取UCWA可用於通過自動發現獲得授權的oauth標記。 – ShelbyZ

    +0

    你能告訴我還是指向一個資源,顯示如何做到這一點?我不能從我的生活中找出他們所擁有的文件。 – spiroski

    +0

    具體而言,我不確定如何在我的Web應用程序服務器應該能夠代表用戶安排會議的情況下執行此操作,即使用戶未登錄到該站點(所以我應該在訪問用戶不在我的網站上)。 – spiroski

    回答

    0
  • 獲取已返回的授權碼,並用它來生成令牌
  • 的訪問在此步驟中,你需要指定resource=https://webdir1e.online.lync.com資源(請注意1e)以訪問此特定中心。

    實際上,您必須從每個新服務器開始進行身份驗證,所有webdirXX,然後是webpoolXXXXX。

    我寫了一篇巨大的互動文章,詳細描述了請求流程(在我花了一週的時間對逆向工程師進行反向工程後,由於MSDN文檔是 - 至少在撰寫本文時是不完整和不正確的) ,也許它可以使用的:

    如果您配置應用重定向URL文章URL(暫時的課程),你甚至可以直接從那裏測試查詢。

    此外,自動發現和驗證碼「在一片」可以在Github上找到(與現場演示):

    相關問題