I have only the HttpConfiguration-Class, and in this class, i can't set the UserNamePasswordPasswordValidator
My problem is that i'm getting an unexcepted redirect to the LoginController (not existing in my project) and the Webbrowser is getting an Http404-Response Code and not the expected Unautorized-ResponseCode.
How can i change this behaviour? Where is this redirect to the LoginController declared, and how can i delete or change this redirect?
jan.baer
Member
5 Points
3 Posts
Avoiding an unexpected redirect to LoginController with BasicAuthentication
Feb 27, 2012 09:54 AM|LINK
Hallo @all,
i'm using the solution from @hilbertZG from this post http://forums.asp.net/t/1771730.aspx/1?HTTPS+and+Basic+Authentication+without+Operationshandler. The only difference is, that i'm using the WebApi not in a selfhosting evironment.
I have only the HttpConfiguration-Class, and in this class, i can't set the UserNamePasswordPasswordValidator
My problem is that i'm getting an unexcepted redirect to the LoginController (not existing in my project) and the Webbrowser is getting an Http404-Response Code and not the expected Unautorized-ResponseCode.
How can i change this behaviour? Where is this redirect to the LoginController declared, and how can i delete or change this redirect?
Thanks
Jan
awebb
Member
204 Points
91 Posts
Re: Avoiding an unexpected redirect to LoginController with BasicAuthentication
Feb 27, 2012 01:06 PM|LINK
Login controller or Account controller?
If the latter, then delete the following from Web.config:-
<authentication mode="Forms"> <forms loginUrl="~/Account/Login" timeout="2880" /> </authentication>jan.baer
Member
5 Points
3 Posts
Re: Avoiding an unexpected redirect to LoginController with BasicAuthentication
Feb 27, 2012 01:27 PM|LINK
Hello Andrew,
it was the AccountController. Thank you very much for the quick solution!
Best regards
Jan