Asp.Net Membership

Feb 16, 2012 at 10:58 PM

Can the forums be adapted to use the Asp.Net membership provider?

Feb 16, 2012 at 11:57 PM

I suppose anything is possible. Personally, I think the membership provider kind of sucks, trying to be everything to everyone. It's almost easier to do the reverse in most cases. Check the bottom of the documentation main page (integration) for more information.

Mar 18, 2012 at 8:19 AM
Edited Mar 18, 2012 at 8:22 AM

You do NOT want the membership provider in here.  We just ripped that trash out of an applicaiton because it's a boated pile of shit.  Custom authentication providers..role your own.  It's been done a hundred times on GOOD teams.  And there's a reason for's not bloated and it only takes a few classes to create one.  Find someone who has and get their code and understand WHY you do not want to keep resortingto the stupid ASP.NET Memberhip crap provider.

Please do your research, don't just take whatever bells and whistles Microsoft throws at you.  A lot of it is BLOAT and PAIN.  Yes sometimes you have to code developers... YES.

If you want some example code of a custom auth provider I would be happy to provide it to you mxmissle but please do not advocate the pile ASP.NET Membership provider and its 15 tables, 15 views and BLOATED heavy, overcomplex framework structure.

The problem with the .NET community is that a lot of developers are not exprienced enough or will never be on a team where the light shines and you see why certain teams and ecommerce sites do not use crap like the ASP.NET Membership provider.  Why good teams know that using ALL stored procs as the basis to CRUD your application is trash (use LINQ to SQL, another ORM that is NOT Entity Framework, or use parameterized SQL calls from your C# code).  Parameterized, this is not the old inline SQL that was "bad" back in the day.  Do your research.  And PLEASE PLEASE DO NOT USE MS DATASETS...pile of shit.

Oct 15, 2012 at 12:14 AM

Apologies as I realize that this post is almost 8 months old but just would like a little direction. 

Unlike others I don't have an opinion against using the latest DefaultMembership providers (down to 6 tables, no SPs, etc.) from Microsoft. It is a much better solution that what they had previously. Anyhow, since I am using this in my current MVC4 app, I don't want to swap it out or roll my own at this time ... but I also would like to integrate PopForums into this site. 

Since I have taken a 4 year hiatus to build WinForms and WPF apps, I am a little behind in the ASP.Net world. What would be the best direction in integrating PopForums for use with the DefaultMembership providers? Change all the SQL calls within the Repositories to use the Membership (API/) tables or  just use business rules and try to sync the users between the multiple tables?

Thanks is advance for any suggestions!


Oct 15, 2012 at 12:40 AM

I suppose you could Unbind the regular Sql project repositories that call the POP Forums tables for users and such, and instead bind those interfaces to your own classes that call Membership. However, if I recall correctly, there are a few places where the user and or profile tables are queried in joins outside of those repos. You'd have to do a find in files for pf_User to sniff it out.

Personally, I'd probably migrate data out of the membership tables and into the PF tables, and write a Membership provider to hit those instead. I loathe Membership. :)

Oct 15, 2012 at 1:46 AM

Thanks for the quick response ...

I guess that could make some things easier by migrating to your tables though I would lose dynamic profiles (may not be a big deal though). For proof-of-concept, to see if I could get PopForums to work, I did a hack (yes. this will be changed if successful) where I create a PopForums User and Profile when I create a Membership account. I also merged my "AllowAnonymous" attribute with the "PopForumsUserAttribute" so I did not have to change my controller attributes.

Understand your position on Membership, but even with the new providers, you still find it poorly?

Thanks again for your assistance

Oct 15, 2012 at 4:17 AM

I just don't care for it. Keep in mind that PF also does all kinds of logging around security and sessions, which is useful when you need to track down abuse.

Nov 18, 2012 at 5:35 PM

After a brief hiatus ...

I just think I will try to redirect all my actions to your controllers and code ... and then call my custom code as needed. Though I think this is fairly trivial, have you heard of others using this approach? This would allow me to not have to use the Asp.Net Membership bits (removing 6 tables from my database) and only have your "membership" repositories and services to use with my custom code.

Nov 18, 2012 at 6:02 PM

I think that's a good approach. I do something like that on CoasterBuzz. Because I have other things that I tie to a user, I actually reroute the profile page. In my RegisterRoutes method in Global.asax, before I get to AreaRegistration.RegisterAllAreas(), I use this: 

routes.MapRoute("profileRedirect", "Forums/Account/ViewProfile/{id}", new { controller = "Member", action = "Redirect"} );

Then I just use that method to redirect to my custom profile pages (which look like this).

public RedirectToRouteResult Redirect(int id)
     return RedirectToActionPermanent("Index", new {id});

That way, I don't have to change links around the forum views.

Jul 30, 2013 at 12:12 PM
You said membership sucks. Are you suggesting i implement my own provider? and can you give me some sample code or example to walk through
Jul 30, 2013 at 1:34 PM
There are a million tutorials on the Internet about writing a Membership provider. But why bother? Use the forum's login and account management instead. The user object on the HttpContext is going to be one of our User objects.
Jul 30, 2013 at 3:02 PM
I'm working on a new project different from this {pop: forums}, and it will include a high amount of security/authentication system. I thought of using membership (which i've been using and still using) but i was advised by some friends not to use it because it's "an overkill" as one explained another said it's bloated. So i thought to myself that the next option was to create my own security/authentication system? which i will need your advice or guidance on how to go about it.
Aug 1, 2013 at 6:41 PM
So membership is an auth system, and PF has one, and you want to make your own? That doesn't make a lot of sense to me. Get an instance of IUserService ( from PopForumsActivation.Kernel.Get<IUserService>() and go about your business.