Click here to Skip to main content
13,048,584 members (90,952 online)
Rate this:
Please Sign up or sign in to vote.
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 30-Oct-12 6:02am
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 30 Oct 2012
Copyright © CodeProject, 1999-2017
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