自定义ASP.NET身份验证 [英] custom ASP.NET authentication

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

问题描述

嘿专家!

我正在尝试建立一个asp.net网站。我有兴趣为我的自定义用户数据创建自己的数据提供者!



用于身份验证我决定使用FormsAuthentication。

用于保存自定义用户数据我决定制作自己的自定义个人资料提供者。

授权我想使用角色授权



首先是我的决定是真的吗?我应该改变它?不需要使用其他东西代替Pofile通过应用程序保存数据吗?



秒,我需要使用我自己的自定义角色提供程序来使用Role for Authorization我想使用角色授权?



第三,这个计划是真的吗?我应该在这个计划中编码?或者最好在我的自定义配置文件表中有一个名为Role的列,并进行客户和简单的授权!(检查角色列以了解用户角色然后显示其正确的内容)

图片显示计划在我脑海中



非常感谢!

hey experts!
i am trying to make a asp.net website . im interesting to make my own data providers for my custom user data !

for authentication i decide use FormsAuthentication .
for saving custom user data i decide to make my own custom profile provider.
for Authorization i want use Role Authorization

first is my desicion true? i should change it? no need use something else instead Pofile for saving data through the application?

second , i need make my own custom Role provider to use Role for Authorization i want use Role Authorization?

third, is this scheme true? and i should code in this scheme? or maybe its better to have a column named Role in my custom profile Table and make a custome and simple Authorization !?( checking Role column to know whats user role then show its proper content )
picture to show scheme in my mind

very thanks !

推荐答案

你的建议当然是可以实现的。我个人使用内置于.net的默认提供程序,因为大部分工作都是由查看此处获取信息关于这些 [ ^ ] 。 SQL提供程序与MS SQL-Server结合使用,您甚至可以创建数据库使用内置的aspnet_regsql.exe [ ^ ]



也就是说,一个尺码并不适合所有,你可以将现有的供应商(包括基础供应商的子类完全干净)创建为自定义供应商,但我认为这只值得现有的不符合您的要求。我的建议是为每一部分功能(auth,角色等)尝试现有的功能,直到他们不做你想做的事情,然后在你自己的自定义提供商上工作。
What you suggest is certainly achievable. Personally I use the default providers built in to .net as most of the effort is taken care of see here for information about these[^]. The SQL providers work in conjunction with MS SQL-Server and you can even created the database using the built in aspnet_regsql.exe[^]

That said, one size does not fit all, you can subclass the existing providers (including the base providers for a completely clean slate) to create custom ones, but I think this is only worth it if the existing ones do not meet your requirements. My advice is to try the existing ones for each tranche of functionality (auth, roles etc) until they don''t do what you want and then work on your own custom provider.


这篇关于自定义ASP.NET身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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