REPOST: bug in Forms Authentication



hi, i tried posting this last month but got no takers, trying again!

i have a minor problem where some users log in with capital letters
for their username, which looks bad when displayed on screen and also
causes discrepancies in some user activity logs maintained in the
database, e.g. "JOE BLOGGS Login" and "Joe Bloggs Login". in an
attempt to standardise the username case, i tried to read the correct
username from the database, this code used to work fine:

protected void Login1_LoggedIn(object sender, EventArgs e)
{
// find the Membership User
MembershipUser u = Membership.GetUser(this.Login1.UserName);
if(u == null)
throw new Exception("Could not locate user account for
" +
this.Login1.UserName);

// use the correct username case (from the aspnetdb database)
for the
login cookie
FormsAuthentication.SetAuthCookie(u.UserName, true);

}

but there seems to be a behaviour change since asp.net 3.5, this code
no longer works as expected, Membership.Username now returns the same
case as was submitted by the user, so the Username property is
actually not coming from the database at all. surely this can't be
'by design'?? can anyone confirm if this is a bug, and/or suggest a
workaround?
many thanks
tim
.



Relevant Pages

  • Query to show last time someone logged in.
    ... When my users log into my database a query automatically runs and creates a ... new record in a table called tblUsageStats. ... Username and the Current date & time ). ...
    (microsoft.public.access.queries)
  • Re: How to change username?
    ... It has no connection to stored data. ... then have the users log in using the new names. ... The database control expenses for around 30+ ... Is there a way I can link the old username with ...
    (microsoft.public.access.security)
  • Re: Is there a way to identify all of a users logins?
    ... Our users log in to their ... > workstations as local users and into Novell. ... > use a 3rd party utility to query Novell for the username with which they ... > used to log into the Windows file server. ...
    (microsoft.public.win32.programmer.networks)
  • Re: How to change username?
    ... I'm reading that erick is storing the username with the data that 'belongs' to that user. ... So you'll need to delete all the users (no you can't change the existing usernames), recreate them, and then run a bunch of update queries to update the existing data to the new username. ... then have the users log in using ... The database control expenses for around 30+ ...
    (microsoft.public.access.security)
  • Forms Authentication, Membership.Username case is wrong
    ... i have a minor problem where some users log in with capital letters ... attempt to standardise the username case, this code used to work fine: ... // find the Membership User ... // use the correct username case (from the aspnetdb database) for the ...
    (microsoft.public.dotnet.framework.aspnet.security)