Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have locked down the user until he login's into the application he can't access any other URL. But now i'm unable to even open up my sign up page due to that authentication. I have tried down the <location> tag in web.config for SignUp but its not working. Please suggest some solution.
HTML
<location path="">
    <system.web>
      <authorization>
        <deny users="?" />
      </authorization>
    </system.web>
  </location>

  <location path="~/SignUp">
    <system.web>
      <authentication mode="Forms">
        <forms loginUrl="~/SignUp" timeout="20"/>
      </authentication>
      <authorization>
        <deny users="?"/>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  
  <system.web>
    <httpRuntime targetFramework="4.5" />
    <compilation debug="true" targetFramework="4.5" />
    <authentication mode="Forms">
      <forms path="/" loginUrl="~/Login" timeout="2880" />
    </authentication>
<system.web>

This is what i'm doing currently in my web.config<
Posted
Updated 27-Apr-15 20:01pm
v2

remove location path=""
Try this

XML
<location path="Signup">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>

<system.web>
    <httpRuntime targetFramework="4.5" />
    <compilation debug="true" targetFramework="4.5" />
    <authentication mode="Forms">
      <forms loginUrl="Login.aspx" timeout="2880" />
    </authentication>
   <authorization>
      <deny users="?" />
    </authorization>
<system.web>


I assume you have a Signup folder under the main folder and a login.aspx page in the main folder
 
Share this answer
 
v2
Hi,


Thanks for the help ... yes i do have but i don't want the user to move to any other page that's why i can't remove that location tag ... else user can directly change the URL and access other pages without any authentication
 
Share this answer
 
Comments
Abdul Samad KP 28-Apr-15 8:08am    
Your signup page is in a separate folder or in the main folder?
Can u please explain your folder structure
Well i have changed a bit in my solution ... Instead of SignUp now i have a Register Page... hierarchy is like this ... View --> Login --> Index.cshtml and Register.cshtml
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900