Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
hi,
i have a problem with asp.net authorization .
 
i have used Forms Authentication in my asp.net app,
and authorization with this config :
<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 :
<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
<location path="Default.aspx">
   <system.web>
     <authorization>
       <allow users="*" />
     </authorization>
   </system.web>
 </location>
 
. plz help, sorry for bad english.
Posted 28-Oct-10 2:06am
Areff781
Comments
NMehta83 at 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 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
Areff at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 921
1 OriginalGriff 250
2 Volynsky Alex 205
3 Kishore Pogaru 160
4 Richard Deeming 140
0 OriginalGriff 5,640
1 Sergey Alexandrovich Kryukov 4,693
2 CPallini 4,540
3 George Jonsson 3,132
4 Gihan Liyanage 2,445


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 28 Oct 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100