Authentication 使用表单身份验证不打开匿名用户不需要登录就可以看到的页面
我正在Visual Studio 2019中使用formsauthentication。因为我使用的是友好的URL,所以下面显示了表单身份验证的代码Authentication 使用表单身份验证不打开匿名用户不需要登录就可以看到的页面,authentication,authorization,visual-studio-2019,forms-authentication,Authentication,Authorization,Visual Studio 2019,Forms Authentication,我正在Visual Studio 2019中使用formsauthentication。因为我使用的是友好的URL,所以下面显示了表单身份验证的代码 <system.web> <authentication mode="Forms"> <forms name=".ASPXAUTH" loginUrl="Login" defaultUrl="Home" slidin
<system.web>
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="Login" defaultUrl="Home" slidingExpiration="true"
timeout="60"></forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
以上web.config中的配置工作正常。我现在想添加一个用户注册页面,它不需要对用户进行身份验证。我为此添加了以下代码:
<configuration>
<location path="Register">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
我不知道为什么我不能访问注册页面而不登录页面。我尝试使用register.aspx,但仍然无法登录。我可以在以下位置查看此url:
https://localhost:44327/Login?ReturnUrl=%2fRegister
在较旧的VisualStudio中,它曾经工作过。我已允许所有用户访问该页面,但注册页面未经登录仍无法打开。匿名用户如何访问注册页面