久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何從MobileServiceUser獲取用戶名、郵箱等?

How to get user name, email, etc. from MobileServiceUser?(如何從MobileServiceUser獲取用戶名、郵箱等?)
本文介紹了如何從MobileServiceUser獲取用戶名、郵箱等?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

經過大量研究,我已經讓我的 WPF 應用程序通過 Azure 移動服務登錄用戶.我的移動服務連接到我設置的 Azure Active Directory.但是,當我使用 MobileServiceClient.LoginAsync(...) 登錄用戶時,MobileServiceUser UserId 似乎處于不可讀的哈希中.例如,它看起來像:Aad:X3pvh6mmo2AgTyHdCA3Hwn6uBy91rXXXXXXXXXX".這究竟是什么?

After a lot of digging around I've got my WPF application signing users in via Azure Mobile Service. My Mobile Service is connected to an Azure Active Directory that I have set up. However, when I log the user in with MobileServiceClient.LoginAsync(...) the MobileServiceUser UserId is in an unreadable hash it seems. For example it looks like: "Aad:X3pvh6mmo2AgTyHdCA3Hwn6uBy91rXXXXXXXXXX". What exactly is this?

我想獲取用戶的顯示名稱以使用,但我不知道如何使用.

I'd like to grab the user's display name to use but I can't figure out how.

推薦答案

這是 Azure Active Directory 的用戶 ID.您需要創建一個服務來通過服務公開您的 AAD 信息,并使用您從用戶那里獲得的訪問令牌檢索附加信息.

That is the userID of Azure Active Directory. You need to create a service to expose your AAD info through a service and retrieve the additional information using the access token you get from your user.

第一:

    ServiceUser user = this.User as ServiceUser;
    var identities = await user.GetIdentitiesAsync();
    var aad = identities.OfType<AzureActiveDirectoryCredentials>().FirstOrDefault();
    var aadAccessToken = aad.AccessToken;
    var aadObjectId = aad.ObjectId;

這將為您提供訪問令牌和 objectID ,然后您需要通過 AAD 圖形 API 查詢信息.https://msdn.microsoft.com/library/azure/dn151678.aspx查看示例請求部分.您應該向查詢提供您獲得的訪問令牌和 objectId.

This will give you the access token and objectID , then you need to query the information through AAD graphy API. https://msdn.microsoft.com/library/azure/dn151678.aspx Look at the sample request part. You should provide the query with the access token you got and objectId.

這篇關于如何從MobileServiceUser獲取用戶名、郵箱等?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

ASP.NET Core authenticating with Azure Active Directory and persisting custom Claims across requests(ASP.NET Core 使用 Azure Active Directory 進行身份驗證并跨請求保留自定義聲明)
ASP.NET Core 2.0 Web API Azure Ad v2 Token Authorization not working(ASP.NET Core 2.0 Web API Azure Ad v2 令牌授權不起作用)
ASP Core Azure Active Directory Login use roles(ASP Core Azure Active Directory 登錄使用角色)
How do I get Azure AD OAuth2 Access Token and Refresh token for Daemon or Server to C# ASP.NET Web API(如何獲取守護進程或服務器到 C# ASP.NET Web API 的 Azure AD OAuth2 訪問令牌和刷新令牌) - IT屋-程序員軟件開發技
.Net Core 2.0 - Get AAD access token to use with Microsoft Graph(.Net Core 2.0 - 獲取 AAD 訪問令牌以與 Microsoft Graph 一起使用)
Azure KeyVault Active Directory AcquireTokenAsync timeout when called asynchronously(異步調用時 Azure KeyVault Active Directory AcquireTokenAsync 超時)
主站蜘蛛池模板: 久久综合狠狠综合久久综合88 | 国产精品视频不卡 | 天天精品在线 | 午夜久久久 | 日韩乱码av | a级在线 | 欧美激情精品久久久久久免费 | 91中文字幕在线观看 | 天天做日日做 | 国产一区二区三区免费 | 国产精品高清在线 | 亚洲在线一区二区 | 在线中文视频 | 亚洲成人在线网 | 亚洲精品视频在线看 | 亚洲激情av| 毛片免费在线观看 | 激情综合五月 | 成年无码av片在线 | 亚洲综合字幕 | 精品国产乱码久久久 | 永久看片| 欧美1区 | 一区二区中文字幕 | 中文字幕动漫成人 | av三级 | 秋霞在线一区 | av国产在线观看 | 日韩精品激情 | 免费黄色日本 | 国产这里只有精品 | 国产成人一区二区 | 久草免费视| 一区二区三区 在线 | 亚洲精品一二三 | 久久久久久国产精品mv | 视频一二三区 | 国产精品久久久久久久久久久久久久 | 国产一区二区精品在线观看 | 久久精品视频在线观看 | 91精品久久久 |