Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3335712
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:02:59+00:00 2026-05-18T00:02:59+00:00

I have been thinking for a good while about how to tackle the problem

  • 0

I have been thinking for a good while about how to tackle the problem of implementing an ID based user system while using ASP.NET MVC. My goals, much like StackOverflow’s system are as follows:

  • Allow the users to change their nicknames without the “avoid duplicate” restriction.
  • Allow the users to authenticate via OpenID (not with password for the time being).

I wanted to avoid as much rework as possible, so I at first thought of using the membership, role and (perhaps) profile providers, but I found they were username based.
I thought of adapting the hell out of the SqlMembershipProvider, by using the username field to store the IDs and throwing UnsupportedException on password based methods and the like, just so as to be able to use the other systems. But it feels unwieldy and kludgy (if possible to do at all).

On the other hand, maybe I should roll up my own user system, but I’m not sure if even if I can’t use the providers, I can still use some of MVC’s features (plug my code in with MVC somewhere, I can think of AuthorizeAttribute off the top my head).

So I was wondering if anyone had run into the same design problem, and what solutions they had come up with.

The more detail the better!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:02:59+00:00Added an answer on May 18, 2026 at 12:02 am

    I had to set up a quick membership system for a client, they had some requirements that didn’t allow me to use the built-in right off the bat nor the time to build what they wanted. I have plans to eventually roll-out a complete membership management system, but like you, I needed something now. I went with the following plan, which will, eventually, allow me to swap out the built-in providers for my own – time constraints and deadlines suck:

    I have my own Personal User Table (PT) – MembershipId, UserName, Email, superflous profile info. This is what the app uses for any user information. It’s a class, it can be cached, saved in the http context, cookie – however you want to handle your user info.

    I then set up the SqlProfileProvider for authentication, authorization, and roles. I don’t use the profile provider (even for trivial settings) because it’s a pain in MVC. I made no changes to the built-in providers. This is what I’m using for authentication and authorization.

    When creating a user, my code does the following:

    1. Check PT for user name and email, per my rules
    2. Create Guid – MembershipId
    3. Create MembershipUser, the MembershipId is the username (the email is irrelevant and not used), and user password, question and answer, etc.
    4. Create the user in PT with the profile values and use MembershipId as the PrimaryKey.

    On login, I get the MembershipId from PT, validate against Membership with the MembershipId and the password and I’m done..

    When deleting a user, I do the following:

    1. Check PT for user, make sure I can/should delete
    2. Get MemberShipId
    3. Use a transaction
    4. Delete from PT
    5. User Membership.DeleteUser(MembershipId, true) – this ensures that the user is deleted from teh membership and other aspnet_ tables
    6. commit

    And it works as expected 🙂

    A few things:
    User.Identity.Name will be the MembershipId (Guid). This is used for SignIn and Role management. My PT is where the user’s info (save the password) is saved. I can change user names, emails, etc with no impact on Membership or Roles because Membership is based on the PrimaryKey from PT.

    The signin requires an extra DB hit because you need to query PT to get the MembershipId to validate against (you could cache).

    The built-in auth system is really heavy – if you look at the sprocs you will see all the hoops it goes through to validate a user. I’d recommend eventually getting away from it. But in a tight spot, it does a good job – and if you don’t have a milion users, I don;t think it’d be a problem.

    I didn’t consider OpenId and I’m not sure how you would integrate it, although I think you could probably do the same thing as above and instead of validating against actual credentials (after they come back validated form OpenId) just log in the user using the MembershipId (don;t validate against Membership).

    For me, the main point behind this was that the app uses a custom user model, allowing for changes to user name, email, names, etc. Without impacting the auth and roles. When I am ready to change to the complete system, I can change it without worrying about the impact to the app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been thinking about this problem for a while and have yet to come
In asp.net mvc, I have been thinking it would be more advantageous to specify
Here's a little problem I've been thinking about for a while now that I
I have been thinking quite a bit here lately about screen scraping and what
I am after so advice really. I have been thinking about a client server
Ok, have a bunch of questions that I have been thinking about the past
I have recently been thinking about the difference between the two ways of defining
I've been thinking about the number of projects we have in-house that are still
I've been thinking about software estimation lately, and I have a bunch of questions
I've been thinking about this object oriented design question for a while now and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.