我們一直在嘗試使用帶令牌的CSOM/REST身份驗證承載頭請求向Sharepoint發出請求。它與下面這個問題:JWT CSOM/REST Azure Active Directory
C# CSOM Sharepoint Bearer request from azure active directory
只有一個鏈接/例如,工程所有其他包括Android ADAL方法不起作用。
https://samlman.wordpress.com/2015/02/27/using-adal-access-tokens-with-o365-rest-apis-and-csom/
他們似乎並不長返回一個道理,當我們看看JWT解析器的道理,我們可以看到,SCP值是不同的,失敗的人有user_impersonate,但工作人員有AllSites.Manage AllSites.Read AllSites.Write MyFiles.Read MyFiles.Write。 aud url也是不同的,是這些問題中的一個還是兩個,以及如何使它工作?
這是失敗的:
{
"aud": "https://srmukdev.onmicrosoft.com/3Squared-Api-Test",
"iss": "...",
"iat": ...,
"nbf": ...,
"exp": ..,
"acr": "...",
"aio": "...",
"amr": [
"pwd",
"mfa"
],
"appid": "...",
"appidacr": "0",
"e_exp": ...,
"family_name": "...",
"given_name": "...",
"ipaddr": "...",
"name": "...",
"oid": "...",
"onprem_sid": "...",
"platf": "3",
"scp": "user_impersonation",
"sub": "...",
"tid": "...",
"unique_name": "...",
"upn": "...",
"ver": "1.0"
}
這是工作的那些:
{
"aud": "https://srmukdev.sharepoint.com/",
"iss": "...",
"iat": ...,
"nbf": ...,
"exp": ...,
"acr": "...",
"aio": "...",
"amr": [
"pwd",
"mfa"
],
"app_displayname": "...",
"appid": "...",
"appidacr": "0",
"e_exp": ...,
"family_name": "...",
"given_name": "...",
"ipaddr": "...",
"name": "...",
"oid": "...",
"onprem_sid": "...",
"platf": "3",
"puid": "...",
"scp": "AllSites.Manage AllSites.Read AllSites.Write MyFiles.Read MyFiles.Write",
"sub": "...",
"tid": "...",
"unique_name": "...",
"upn": "...",
"ver": "1.0"
}
嗨薛飛,是的,這是問題,資源名稱是什麼需要改變。我現在可以使用不記名令牌獲得訪問權限,似乎無法使用GetUserProfilePropertiesFor方法獲取用戶用戶配置文件屬性,但會引發另一個問題。非常感謝 – Andrew