如何使用当前的 Windows 登录用户对 UWP 应用进行身份验证 [英] How to Authenticate UWP app using Current Windows LoggedIn user

查看:24
本文介绍了如何使用当前的 Windows 登录用户对 UWP 应用进行身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我的企业 UWP 应用程序使用用户的 AD 用户名和密码进行身份验证,这通常与 Windows 登录用户相同.我需要删除此要求并让用户根据当前 Windows 用户直接登录到应用程序.我一直在搜索,发现它用于网站,但没有用于应用程序.我正在使用以下客户端:

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 目录,但它可能是具有域凭据 (ADFS) 的企业 Active Directory,并且使用 UWP 应用程序的用户将使用与 Windows 登录凭据相同的凭据登录.因此,我正在寻找解决方案,其中当前登录的 Windows 用户无需再次输入凭据即可登录.它可能类似于 Chrome/IE 浏览器自动登录内网站点.


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.

这篇关于如何使用当前的 Windows 登录用户对 UWP 应用进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆