Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i have a problem with asp.net authorization .

i have used Forms Authentication in my asp.net app,
and authorization with this config :
XML
<authentication mode="Forms">
      <forms loginUrl="~/Login.aspx" timeout="120" path="/" defaultUrl="~/Default.aspx" slidingExpiration="false" name="clientInfo" enableCrossAppRedirects="false" requireSSL="false" protection="All" cookieless="AutoDetect" />
    </authentication>
    <authorization>
      <deny users="?" />
    </authorization>


and with this configs i want to allow all user to see some resources :
XML
<location path="Register.aspx">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="Default.aspx">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>


there is not problem with these , my problem is that when i want to see my site with url , the site automaticaly located to Login.aspx page ,
althought i mentioned Default.aspx at here
XML
<location path="Default.aspx">
   <system.web>
     <authorization>
       <allow users="*" />
     </authorization>
   </system.web>
 </location>


. plz help, sorry for bad english.
Posted
Comments
NMehta83 28-Oct-10 8:43am    
Have you checked the Annonymous access rights on your IIS settings?
Make the checkbox checked for the Annonymous access.
Areff 30-Oct-10 7:10am    
I asked from my host , they said that if your site has not annonymous access it can not be accessible. and your site has annonymous access.

1 solution

Correct me if I get this wrong. You have implemented Forms Authentication and exposed few pages to be viewed by all. Now, if you try to access any of the exposed page, you are taken back to Login page. Now, if this is the case then whats abnormal? Based on forms authentication implementation, you are forced on a login page. Once you login, you will be taken back to the page that you were trying to access. It's the expected behavior.
 
Share this answer
 
Comments
Areff 28-Oct-10 17:16pm    
No, everythings is ok with forms authentication , my problem is that when i trying to see the default.aspx , where it is excepted to view by all with site url , i prospect to view default.aspx when it is specified to be a default document in web.config, but url redirect to login.aspx insted of default.aspx .

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