Search code examples
asp.netwebformsforms-authentication

Forms authentication redirects back to Login.aspx after authenticating


Problem: Forms authentication appears setup correctly. When running the following lines, the application is redirected back to the the login page. No calls to other pages are made.

e.Authenticated = true;
FormsAuthentication.RedirectFromLoginPage(Login1.UserName, true);

Web.config

<system.web>
<authentication mode="Forms">
    <forms name=".ASPXFORMSDEMO" loginUrl="login.aspx" protection="All" path="/" timeout="180" enableCrossAppRedirects="true" domain="xyz.com"/>
</authentication>
<authorization>
    <deny users="?"/>
    <allow users="*"/>
</authorization>
</system.web>

Solution

  • The problem was with the web.config. The test workstation where this was setup did not like the part...

    domain="xyz.com"
    

    Removing that made the entire thing work.