Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All!

I am experiencing a strange behavior of FormsAuthentication. I have several controllers with Authorize attribute, but there are some wihout, like the default one, and the one with the login action.
When I am opening the application in a browser, I got redirected to the login action. But the default action is not protected. I have a link to / on the page, and after several clicks and redirections it is letting me see the default action view as expected. There is no logic in how many tries I have to do to get to the default view. Sometimes one is enough sometimes ten. No matter what browser I am using, no matter I am using IIS Express or local IIS on Win7. But it is not occurring with the Development server.
These are real http 302 redirections.

Please, help me with some ideas.

Thank you in advance!
Posted
Comments
n.podbielski 30-Oct-12 15:53pm    
What do you mean by 'let you see'? Default action redirects you to login once and to / second try? Did you logged in?
Zoltán Zörgő 30-Oct-12 16:23pm    
First question: yes, but not every time on second /, sometimes only after many /'s, but without every logic
Second question: there is no problem if I log in, but these are not protected controllers, I shouldn't need to log in to access them. And the protected controllers work properly, they redirect to login if needed and their actions are called if authorization is performed.
n.podbielski 31-Oct-12 3:11am    
Maybe your web.config authorization is wrong. Maybe you configured it to protect all pages not only your [Autorize] attr protected actions and controllers?
Zoltán Zörgő 31-Oct-12 10:35am    
I figured it out. Somehow I enabled digest authentication also - but I don't know how, since I found nothing that like in the web.config. Anyway, it had a really wired behavior...
Thanks for your time.
n.podbielski 31-Oct-12 12:17pm    
Settings of IIS parent dir maybe? I am glad if my comment was even remotely helpful. :)

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