Authorization Concept in .net
Introduction:
In this article we going to know about the authorization concept in .net.
Authorization is a process of allowing or denying resources to the users.
To know more about checkout the example, I have used VS2008.
Step 1: create a website and on the solution explorer check the web.config file
Step 2:(For Application)
Now change the authentication mode to Forms" to apply the authorization concept, and also add authorization in system.web section to allow or deny users.
This will be used only for creating an application and give permission to some users to use like office use.
But at the same time if I have a website and need users to see registration webpage and other web page if they logged in, then we have to use the below code
Step 3:(For webpage)
Still now we have seen how to allow authenticated users, now we going to see how to allow particular users
Step 4:(To allow particular users for application)
This will allow only 'ramanand" and restrict others.
Step 5:(To allow particular users for website)
As of now we have seen allow or deny anonymous users, now we going to learn how to apply this authorization concept for various roles users like admin
here,
I have two folders one is Administrator folder and another one is Customer folder. Now I want give permissions like Admin role users are able to access both the folders and Customer role users are able to access only Customer folder for that we need to set the condition like this in web.config file.
In this way we can use the authorization concept in asp.net and also note that before use deny we have to use allow tag!
Introduction:
In this article we going to know about the authorization concept in .net.
Authorization is a process of allowing or denying resources to the users.
To know more about checkout the example, I have used VS2008.
Step 1: create a website and on the solution explorer check the web.config file
Step 2:(For Application)
Now change the authentication mode to Forms" to apply the authorization concept, and also add authorization in system.web section to allow or deny users.
This will be used only for creating an application and give permission to some users to use like office use.
But at the same time if I have a website and need users to see registration webpage and other web page if they logged in, then we have to use the below code
Step 3:(For webpage)
Still now we have seen how to allow authenticated users, now we going to see how to allow particular users
Step 4:(To allow particular users for application)
This will allow only 'ramanand" and restrict others.
Step 5:(To allow particular users for website)
As of now we have seen allow or deny anonymous users, now we going to learn how to apply this authorization concept for various roles users like admin
here,
I have two folders one is Administrator folder and another one is Customer folder. Now I want give permissions like Admin role users are able to access both the folders and Customer role users are able to access only Customer folder for that we need to set the condition like this in web.config file.
In this way we can use the authorization concept in asp.net and also note that before use deny we have to use allow tag!
No comments:
Post a Comment