1

I built a web app a while back that is miss behaving out of the blue. Page.User.Identity.Name returns the machine name ie phil_toshiba/phil instead of the username i set when the user logs in through the log in form (should be an email address):

System.Web.Security.FormsAuthentication.RedirectFromLoginPage(tb_email.Text, true);

I dont know why it has only just started doing it but it doesn't do it on the live site just the local project i need to work with to update some features. the live and local are in sync (code is exactly the same) only difference is the live site is compiled and using iis.

EDIT this is the authentication tag in my web.config file:

<authentication mode="Forms"  >
  <forms loginUrl="Default.aspx" name=".ASPXFORMSAUTH" defaultUrl="Sections.aspx">
  </forms>
</authentication>
user987723
  • 945
  • 3
  • 12
  • 33
  • Can you please give information about the web.config file of you local project? – Amit Rai Sharma Dec 01 '11 at 12:12
  • Please, look [here][1] [1]: http://stackoverflow.com/questions/1267071/how-to-get-windows-user-name-when-identity-impersonate-true-in-asp-net – idm Dec 01 '11 at 12:13

1 Answers1

4

Check your web.config, it should be set to use Forms authentication not Windows:

<system.web>
    <authentication mode="Forms"/>
</system.web>
Chris Fulstow
  • 41,170
  • 10
  • 86
  • 110