C# - WPF作为不同的用户运行,但在App中使用登录的凭据 [英] C# - WPF Run as different user but use logged in credentials within the App

查看:71
本文介绍了C# - WPF作为不同的用户运行,但在App中使用登录的凭据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


不确定是否可能,但标题几乎解释了它。我正在构建一个桌面应用程序。用户需要使用特殊帐户来运行应用程序,以便他/她可以在应用程序中使用某些命令。但与此同时,在某些部分的应用程序中,我希望用户
能够使用他/她登录的凭据(例如访问他们已经过身份验证的网站)。这有可能吗? 


如果可能的话,有人会给出一个简单的C#示例吗? 


提前致谢。 




BesiktASK

解决方案


.NET Framework使用System.Security.Principal.IIdentity和System.Security.Principal .IPrincipal接口作为身份验证和授权的基础,并通过实现这些相当简单的接口,您可以应用您自己的应用程序中的自定义身份验证


阅读本文: https://blog.magnusmontin.net/2013/03/24/custom-authorization-in-wpf/


最诚挚的问候,


Bob


Hi Everyone,

Not sure if possible but the title pretty much explains it. I'm building a desktop app. The user needs to use a special account to run the app so he/she can use some commands in the app. But at the same time, within the app in some sections, I want the user to be able to use his/her logged in credentials (for example accessing a website that they already have been authenticated). Is this even possible? 

Can someone give a simple C# example if possible? 

Thanks in advance. 


BesiktASK

解决方案

Hi,

The .NET Framework uses the System.Security.Principal.IIdentity and System.Security.Principal .IPrincipal interfaces as the basis for authentication and authorization and by implementing these fairly simple interfaces you can apply your own custom authentication in your applications.

Read this article :https://blog.magnusmontin.net/2013/03/24/custom-authorization-in-wpf/

Best Regards,

Bob


这篇关于C# - WPF作为不同的用户运行,但在App中使用登录的凭据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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