我試圖複製下面的示例https://github.com/Azure-Samples/active-directory-dotnet-windows-store(一個Windows商店應用程序對azure AD進行身份驗證),但我用Azure函數替換Web應用程序。Windows商店應用程序進行天藍色功能驗證
在功能,代碼檢查用戶是否登錄如下:
ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/scope").Value.Contains("user_impersonation"))
但這並不包含所需的值,以及其他調用不返回任何值,或者(如ClaimsPrincipal .Current.FindFirst(ClaimTypes.GivenName));
你知道發生了什麼嗎?