thebigo
asked on
Windows authentication works in debug but not in published web site
Hello
I have a web application written in VB (VS 2008) with the code below in global.aspx.
When I run the application in Debug it works perfectly - I go to default.aspx. When I publish the application and run through a normal browser session the User.Identity.Name is blank and User.Identity.IsAuthentica ted is False and I go to login.aspx. My PC is a 64bit Vista Ultimate. In IIS7 I have both Anonymous Authentication and Windows Authentication enabled. I have a separate Application Pool for the application and have given NETWORK SERVICE read access to the site.
Can anyone help??
Regards
James
I have a web application written in VB (VS 2008) with the code below in global.aspx.
When I run the application in Debug it works perfectly - I go to default.aspx. When I publish the application and run through a normal browser session the User.Identity.Name is blank and User.Identity.IsAuthentica
Can anyone help??
Regards
James
If txtReader.GetElementsByTagName("Security").Item(0).InnerText = "Windows" And User.Identity.IsAuthenticated Then
authUserName = User.Identity.Name
x = InStr(authUserName, "\")
sessionHandler.UserName = Right(authUserName, Len(authUserName) - x)
Else
Response.Redirect("login.aspx")
end if
Try disabling Anonymous Authentication and just keep the Integrated Windows authentication enabled.
ASKER
If I do that I get a Windows login prompt before any page is displayed.
Regards
James
Regards
James
If you login with your username and password in that prompt are you redirected to the default.aspx page? Have you enabled Windows authentication in Web.Config and are you using a domain acount or local user account?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.