WPF中的身份验证和授权 [英] Authentication and authorization in WPF

查看:488
本文介绍了WPF中的身份验证和授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我试着在WPF中找到关于身份验证和授权的任何好教程,但我找不到任何东西



所有我发现的是关于ASP.NET和WCF和MVC



我想要有关WPF的完整和好的教程



我尝试过:



我试图找到关于身份验证和WPF中的授权,但我找不到任何东西

解决方案

请看一下这篇文章,这是谷歌首次发现的身份验证和WPF授权:)



WPF:实现自定义身份验证和授权 - TechNet文章 - 美国(英语) - TechNet Wiki [ ^ ]



本文提供了有关如何在WPF应用程序中实现自定义身份验证和授权的分步代码示例,方法是实现从IIdentity和IPrincipal接口派生的类并覆盖应用程序线程的默认标识。 / blockquote>

您好MrProgrammer_78



我必须同意_duDE_的帖子。我不认为Magnus Montin在他的文章。 Magnus是Microsoft MVP,这意味着他拥有一些可靠且经过验证的.NET技术知识。此外,该文章已由Microsoft合作伙伴审核。对我而言,它已经意味着什么。



我不知道你对安全的正式要求是什么。但我必须告诉你,上周我根据Magnus Montin的文章和Code Project的Elvin Cheng的文章实现了自定义身份验证和授权(这里)。您也可以浏览文章的评论,其中我描述了如何实施动态授权。



从您上面的帖子中我感觉我们都在做类似的工作应用程序类型 - 或多或少的独立应用程序,通过安全性映射(用户角色与访问权限)连接到一个或多个数据库,其中WPF控件根据用户的安全上下文隐藏/可见或启用/禁用。我正在研究这样的应用程序,但针对不同的行业。结合这些方法,我成功地在我的应用程序中实现并测试了安全性。



您可以浏览Elvin的文章(也许还有Magnus的文章)重新考虑一下仍然需要坚持实现几个应用程序而不是一个。我的安全实现适用于12个短类和3个数据库表(+一些管理/管理UI)。



如果您有更多问题,请告诉我。



问候

Jiri Novotny


Hi guys,

I try to find any good tutorials about Authentication and Authorization in WPF but i could not found any thing

all i found are about ASP.NET and WCF and MVC

I want complete and good tutorials about that for WPF

What I have tried:

I try to find any good tutorials about Authentication and Authorization in WPF but i could not found any thing

解决方案

Please take a look at this article, that was the very first I've found by google with "Authentication and authorization in WPF" :)

"WPF: Implementing Custom Authentication And Authorization - TechNet Articles - United States (English) - TechNet Wiki[^]

This article provides a step-by-step code sample on how you can implement your own custom authentication and authorization in a WPF application by implementing classes that derive from the IIdentity and IPrincipal interfaces and overriding the application thread’s default identity.


Hi MrProgrammer_78

I have to agree with the post from _duDE_. I do not think it is that simple solution provided by Magnus Montin in his article. Magnus is Microsoft MVP which means he has some solid and proven knowledge of .NET technologies. In addition, the article has been reviewed by a Microsoft Partner. For me it means something already.

I do not know what your formal requirements on security are. But I have to tell you that last week I implemented custom authentication and authorization based on the Magnus Montin's article and the article from Elvin Cheng at Code Project (here). You may also browse into the comments to the article where I described how to implement the dynamic authorization.

From your posts above I have the feeling we both are working on similar type of application - more or less standalone application with connection to one or more databases with a security map (user roles vs. access rights) where WPF controls gets hidden/visible or enabled/disabled based on the user's security context. I am working on such application(s) but for different industry. With combining these approaches I successfully implemented and tested the security in my application.

You may browse through the Elvin's article (and maybe Magnus' article again) to reconsider if you still need to stick to implementing several applications instead of just one. My security implementation fit into 12 short classes and 3 database tables (+ some administration/management UI).

Please let me know should you have more questions.

Greetings
Jiri Novotny


这篇关于WPF中的身份验证和授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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