How is the case of User.Identity.Name determined?

Last post 08-14-2009 11:57 AM by rhyolite. 2 replies.

Sort Posts:

  • How is the case of User.Identity.Name determined?

    08-13-2009, 3:12 PM
    • Member
      point Member
    • rhyolite
    • Member since 08-13-2009, 3:02 PM
    • Posts 2

    I have observed that usually User.Identity.Name is mixed case so that for example John Doe in some domain Company would be Company\DoeJ. However, occasionally the user names of certain users on certain servers are lower case, e.g., Company\doej. This seems to change periodically. Furthermore, the same user can bring up the test and production instances of the same application, which are located on two different servers, and occasionally they will be mixed-case in one and lower-case in the other. I cannot find any rhyme or reason to this.

    I suppose my question is how exactly is the User.Identity.Name set, where does the information come from? Why would some users be mixed-case and others lower-case only some of the time on only some of the servers?

    This has been bugging me for a few days. Any feedback would be appreciated.

    ASP.NET 2.0, by the way.

  • Re: How is the case of User.Identity.Name determined?

    08-14-2009, 1:14 AM

    Hi,

    If you check the User table in the ASPNETDB, you will find that both the lower case and original User name entered by the user is stored by this membership provider.

    Each server uses whatever name it wants to use, either the small case or the mxed one.

    Saurabh Nijhawan(B.Tech. CSE,GGSIPU,New Delhi)
    Application Architect, Eminent Solutions, New Delhi.
    Freelancer | Teacher
    Remember to click "Mark as Answer" on the post, if it helped you.
    ASP.NET Weblog
    http://www.saurabhnijhawan.com
    Learning Made Easy


  • Re: How is the case of User.Identity.Name determined?

    08-14-2009, 11:57 AM
    • Member
      point Member
    • rhyolite
    • Member since 08-13-2009, 3:02 PM
    • Posts 2

    I am not using ASPNETDB or membership. I am in a corporate/intranet environment using Active Directory.

    I can quickly reproduce this issue as follows. Create a new web application with a single page:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <asp:LoginName ID="LoginName1" runat="server" />
            </div>
        </form>
    </body>
    </html>

    The LoginName control simply displays User.Identity.Name. If I deploy this application to two different servers, and access them both at the same time, my LoginName shows up as Company\DoeJ on one and Company\doej on the other.

    My question is why is the case of the LoginName (or User.Identity.Name) different on different servers? What determines the case of the LoginName? This seems like it should be a simple question, but I haven't been able to track down a satisfactory answer. Thanks for any help on this.

Page 1 of 1 (3 items)