想要为用户提供授权并检查身份验证 [英] Want to provide user the authorization and check authenctaion

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

问题描述

大家好,这是一个非常常见的问题,但我需要你的帮助。我有一个应用程序,我想创建不同的角色,如管理员,经理和使用。首先,我想检查用户是否有权申请不是,如果是,则要根据其凭据检查我必须提供给他的访问权限。



我所做的是用页面创建不同的文件夹。我创建了一个登录,这是我的默认页面。当用户输入其凭据时,它会检查数据库是否存在。然后它将重定向到主页。 Nw我想要的是当用户输入登录详细信息时,它将检查它是否是有效用户。如果没有,他们会重定向到错误页面,如果是授权用户,则检查他们的角色并授予对页面的访问权限。我怎么能这样做?



提前谢谢。如果你愿意我会给你我的代码。

Hi guys, this is a very common question but i need your help. I have an application in which I want to create different roles like admin, manager, and use. First I want to check whether the user is authorized for the application of not and if yes then want to check according to its credentials what access do I have to provide to him.

What I have done is created different folders with pages. I created a login which is my default page. When a user enters their credentials, it checks with the database if it is present. Then it will redirect to the home page. Nw what I want is when a user enters login details, it will check whether it is a valid user or not. If not, they redirect to error page and if it is an authorized user, then check their role and give access to the pages. How can I do that?

Thanks in advance. If you want I will give you my code.

推荐答案

网上有很多关于这个主题的资料。其中几个:

MSDN:构建安全的ASP.NET应用程序:身份验证,授权和安全通信 [ ^ ]

ASP.NET身份验证和授权 [ ^ ]



如果需要更多,请查看CP本身。
There are a lot of material on web on this topic. Couple of them:
MSDN: Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication[^]
ASP.NET authentication and authorization[^]

If needed more, look here at CP itself.


这篇关于想要为用户提供授权并检查身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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