My website is mainly divided into 3parts. One for administrator, mostly maintenance pages to update database. One for general users who browse the page with accounts logged in. One is for anonymous to browse and check out our products. How could I restrict the users/anonymous to get to my admin pages and how do I restrict anonymous to purchase?
First, you need to set up 3 folders(Admin, Users, Anonymous), then you put the web forms that you want those people who could have access to in the folder. After that you need to set up your users, roles and access rules in the asp.net configuration(Website->Asp.net Configuration). Now, you should see web site Administration tool, go to security. You could set up your users, roles, and access in there. It would allow you to restrict users to certain web forms.
Related
I have an azure web application which is accessible by all the users of our organization.
In a .Net what are the possible ways to restrict access to certain set of users of a web application. MFA is already there, but still I need to restrict it to a specific group of users.
Please let me know how can I proceed further on this using Graph API in C#.
Based on the tags it sounds like you are using Azure AD authentication.
In that case you can go to Azure Active Directory -> Enterprise applications.
Find your application in the list and open it.
Then you can go to Properties tab and set User assignment required? to Yes.
Then open the Users and groups tab and assign the users you want to be able to access the app.
I am developing an application which consists of two types of admission, one for employees of the company that must manage administrative elements and the other should be for users who need to make a purchase in the company, what solution should implement for the kind of access? because access of administrative employees is done, thanks.
PD: Users should not see the menus administrative staff.
Have different roles for each user type. Also have two different master page, one for administration one for users. All your administration related modules must use administration master page (this will have all administration related menus) and general user module must use user master page. After login according to their role type redirect to respective action methods.
Are you using the same authentication layer for both types of users? If so, implement Role Based Access Control (RBAC) -- here's a link to a relevant MSDN article.
If you're not using the same authentication system, then the admin interface should be a separate application than the user system; consider implementing both as "microservices" that share some portion of a persistence layer. Or have the admin app act through an API on the primary application.
In my Application I have three types of users.(1)anonymous user (2) Members and (3) Admin.
I want to create roles for these users: when a user want to visit the site then he/she may see different Menus like an access control list. And when the user want to access the page or perform some sort of operation, then first its role is checked.
Suppose only admin can have the delete Operation access, so other users cannot see the delete operation or if this is not possible then at least he/she cannot allowed to do this operation.
I used WSAT (website administration tool ) for asp.net application ,but later on I came to know that this not a good technique for production server to manage roles and user.
So I want a handsome technique to manage my application users.
Anybody please help .
Is this MVC?
If so, have a look at ASP.NET Identity: http://www.asp.net/identity
Also check out the new Thinktecture Identity Manager, which is meant as a better replacement for the WSAT tool.
http://www.hanselman.com/blog/ThinktectureIdentityManagerAsAReplacementForTheASPNETWebSiteAdministrationTool.aspx
I am developing an MVC3 application and I have gotten to the point where I need to start securing out different areas of the intranet site to particular users.
The site is being used on the intranet and uses windows authentication for login.
Within the database I have a users table which contains numerous fields that determines the users role. This is maintained in the admin area of the site.
Certain users will have the ability to access the admin area, some users will only have the ability to read certain areas of the site but not contribute, etc etc. There are some complicated business rules.
I am looking for how to secure out different areas. I have read a good few articles around using the authorize attribute on controllers for particular groups, this doesn't seem to be a good fit as I understand it I would have to control what users are in what groups from within the configuration of the application whereas the admin users of the application should be ones controlling this via the application itself.
Any suggestions are welcome.
If you are mainly concerned about managing users, ASP.NET does a great job of this with their built-in Web Application Administration Tool. On the top-right of the Solution Explorer, to the right of the refresh button, is a hammer-and -earth tool that you can click on. It allows you to manage users and roles, and from there you can assign the users to roles. Perhaps your admins can use this.
This tells you how:
http://www.asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7
As far as having to put authorize attributes on the controllers/methods, I don't see any way around that. Let me know if I have misunderstood your question.
Assign users to roles and use AuthorizeAttribute.
I am creating a web application that, simply put, allows for the users to create their own "sites" which have their own set of users. I look at the domain name of the request coming in to determine which "site" to display. I need to have completely different sets of users depending on which "site" you are on. For example: If I visit site1.example.com I am able to register as bob. Trying to login to site2.example.com with my credentials from site1 would fail, because I don't have an account there. Likewise, I should be able to create another, independent bob user on site2. Therefore, not only will I need to store additional information with the user (like what site they registered on), I also need to make the username field non-unique. Any ideas on how to accomplish this? I would like to use the built-in security provider in ASP.NET, so I can use things like [Authorize], but if some 3rd-party security suite would work, I am open to that as well.
With Asp.net membership provider ... one easy way is to change "role" s for each set of users. All users registered for site will get role "site1user" assigned. And so on. You can maintain all users in one database ... differentiated by roles.