I am using formsauthentication in Visual Studio 2019. Since I am using friendly urls, I have below shown code for forms authentication.
<system.web>
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="Login" defaultUrl="Home" slidingExpiration="true"
timeout="60"></forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
Configuration in web.config upto above works fine. I now want to add User register page that will not require user to be authenticated. I added following code for this:
<configuration>
<location path="Register">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
I donot know why I am not able to access register page without login in page. I tried using register.aspx but still not able to login. I can this url in: https://localhost:44327/Login?ReturnUrl=%2fRegister
In older visual studio, it used to work. I have allowed all users to access the page but still register page is not opened without login. How can anonymous user access register page?
What I have tried:
I changed to
<location path="Register.aspx">
. set deny anonymous users in
<authorization>