How should I manage membership in my ASP.NET MVC 4 app?
Asked Answered
I

1

6

As I'm in the process of creating my first ASP.NET MVC 4 Internet application, I'm wondering how to best manage membership on the site. The app allows users to register and log on. I'm interested in finding out how to implement a complete solution for managing site membership, including an administrative user interface.

How should I go about adding membership administration facilities to my app? I'm primarily considering two different NuGet packages to base my solution on, SecurityGuard.MVC4 and MvcMembership. Both look like a good starting point for adding membership administration to my app, but I'm finding it difficult to choose as I know so little on the subject.

Impedimenta answered 4/8, 2012 at 13:19 Comment(0)
E
3

I believe Security Guard is what you would want to go with. It gives you a much more complete membership area. I haven't used either myself, however I have made my own, and looking through the links you provided, Security Guard is your best choice for creating an Admin backend.

However if you just need to authorize different sections, check user roles, and perhaps unlock a user, you could probably get by using the built in User and Mebership and Role methods. You would have to create some views and what not but it's not very hard and a good learning experience.

Entomophagous answered 4/8, 2012 at 15:28 Comment(5)
Thanks, I'm about to install Security Guard, I'll review your answer once I've been able to evaluate it.Impedimenta
@Impedimenta Yah, let me know how you like it. I may give it a shot in an upcoming project to see how I like it. It's creator Kahanu is a member here but it doesn't look like he's too active.Entomophagous
Gah, so far I'm stuck on the MvcInstaller package from the same author which is supposed to set up ASP.NET MVC membership. Unfortunately it is bailing with an error message full of gibberish. Reporting it to Kahanu and then we'll see what happens.Impedimenta
@Impedimenta Have you tried installing it from NuGet? (if you don't know what that means, just right click on the Refrences folder and select the last option, or whatever option says NuGet.) It may be faster to post your error on this site (and give me a link, since I'm interested). I'm done for today, but if I have time tomorrow before work, I'll see what happens when I try to install it on a new MVC4 project.Entomophagous
Yes, it is installed via NuGet. I figured out what was wrong in the meantime, MvcInstaller tries to execute everything in App_Data as SQL scripts, even if it's a database file (.mdf)... I have been able to get Security Guard up now, even though it's cost me a bit of grief to get there. So far, I think it looks pretty good, despite a few rough edges.Impedimenta

© 2022 - 2024 — McMap. All rights reserved.