如何使用当前Windows登录用户对UWP应用进行身份验证

问题描述:

当前,我的企业UWP应用使用用户的AD用户名和密码进行身份验证,该用户名和密码通常与Windows登录用户相同。我需要删除此要求,并允许用户基于当前Windows用户直接登录到应用程序。
我一直在搜索很多东西,发现它是在WebSite上找到的,而不是在app上找到的。我正在使用以下客户端:

Currently my business UWP app authenticate using AD username and password from users which is generally same as Windows logged-in User. I need to remove this requirement and let user login directly to app based on current Windows user. I've been searching lot and found it for WebSites but not for app. I'm using following client:

var filter = new HttpBaseProtocolFilter();
Windows.Web.Http.HttpClient client = new Windows.Web.Http.HttpClient(filter);
client.GetAsync(url);

是否有任何资源可以在UWP应用中使用Windows单一登录身份验证?

Is there any resource using which windows single sign on authentication can be done in UWP app?

编辑:

某些解决方案是特定于Azure目录的,但就我而言,它可能并非始终是Azure目录,而是具有域凭据的Enterprise Active Directory( ADFS)和使用UWP应用程序的用户将使用与Windows登录凭据相同的凭据登录。因此,我一直在寻找当前Windows登录用户无需重新输入凭据即可登录的解决方案。它可能类似于Chrome / IE浏览器自动登录到Intranet网站。


Some solution are Azure directory specific, but in my case it may not be Azure directory always but it could be Enterprise Active Directory with Domain Credentials (ADFS) and user using UWP app will use the same credentials to login as Windows login credentials. So, I was looking for solution in which current windows loggedin user can login without entering credentials again. It could be similar to Chrome/IE browsers sign in automatically into intranet sites.

您可以使用以下示例作为参考: 网络帐户管理示例

You can use the following sample as reference: Web Account Management Sample.

它显示了如何获取Azure AD的令牌。这可能是一个很好的起点。

It is showing how to get a token for an Azure AD. It could be a good starting point.