Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET MVC3
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 7:02am
Comments
n.podbielski at 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ő at 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 at 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ő at 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 at 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
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 479
2 Maciej Los 305
3 Mathew Soji 195
4 Afzaal Ahmad Zeeshan 170
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,777
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 30 Oct 2012
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