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 943301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:24:57+00:00 2026-05-15T22:24:57+00:00

When a user logs in with the default implementation of the membership service in

  • 0

When a user logs in with the default implementation of the membership service in an ASP.NET MVC project, they are logged in with a username with whatever case they used when logging in.

For example, I create a user called John. If I then log in as joHN, then User.Identity.Name will equal joHN. I would like it to equal John, the actual user’s login name.

At the moment I’m getting around this like so:

var membershipUser = Membership.GetUser(model.UserName);
var membershipUserName = Membership.GetUserNameByEmail(membershipUser .Email);
FormsService.SignIn(membershipUserName, model.RememberMe);

instead of the default implementation:

FormsService.SignIn(model.UserName, model.RememberMe);

It seems a bit circuitous. Is there a better way to do this?

  • 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-15T22:24:58+00:00Added an answer on May 15, 2026 at 10:24 pm

    Username is case-insensitive throughout the provider stack and the principal is set with whatever value is used to authenticate.

    If you need to enforce case-sensitivity, you will need to either guard all points of authentication as you describe or implement a custom principal/identity.

    I strongly recommend the first and will pray for you if you choose the second. 😉

    Good luck.

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

Sidebar

Related Questions

I have a pop-up window a user logs into, once they are logged in
Imagine an ASP.NET website which displays stock prices when a user logs in. Can
When a user logs in based on default Forms Authentication method, the server creates
When a user logs in with his UserName , I send the UserName to
I have a website and when the user logs in they can click on
I am wondering how do I extend the membership stuff in asp.net? When a
I have an asp.net mvc 3 site that with my own authorize attribute. When
NET web application and a WCF Application that share the same ASP.NET membership database.
I have created a new MVC2 project using the ASP.NET MVC2 Web Application, which
I'm working on a sample project built from the ASP.NET Web Application template (web

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.