how do you Change IIS authentication method to BasicAuthentication? - iis-7

I try to Change IIS authentication method to BasicAuthentication for IIS7?
I try to follow the steps here, because I get that error
Thank you
PS: I was trying this, but I have only this options

Have you enabled the Basic Authentication Module? Here's a guide.

Related

custom asp.net error on a live site

I have recently migrated an ASP.net web site. I get errors, I assume it's due to database connection.
My question is, is it possible to turn on custom errors, even if I don't have the asp.net project code?
In other words,
Can I turn on custom errors on the server remotely?
if you'd like to remotely access and configure an IIS server, you'd need to configure Management Service on the server. I have found a detailed article on how to accomplish this, which you can find here
Custom errors are managed via the Web.Config. So all you need is FTP to modify the Web.config. Otherwise you can look at remotely connecting to IIS if you have that level of rights.

ASP.Net MVC identity infinite redirect loop

I have an ASP.Net MVC5 application, using the Identity "out of the box" template, as per ASP.Net Identity 2.0.0. I need to upgrade it to use the newer code that is in the latest ASP.Net MVC template, namely the use of the SignInManager class.
I have done some A|B comparisons between the code in my original app and the template generated in the latest, and ported over all that I could see what different.
However, I'm getting an odd error, I suspect OWIN related. When I try and Login or Register, it triggers a Redirect loop that eventually crashes the app with a security warning as the URL Query string has concatenated itself to death.
The URL is :
https://localhost:44302/Account/Login?ReturnUrl=%2FAccount%2FLogin%3FReturnUrl%3D%252FAccount%252FLogin%253FReturnUrl%253D%25252FAccount%25252FLogin%25253FReturnUrl%25253D%2525252FAccount%2525252FLogin%2525253FReturnUrl%2525253D%252525252FAccount%252525252FLogin%252525253FReturnUrl%252525253D%25252525252FAccount%25252525252FLogin%25252525253FReturnUrl%25252525253D%2525252525252FAccount%2525252525252FLogin%2525252525253FReturnUrl%2525252525253D%252525252525252FAccount%252525252525252FLogin%252525252525253FReturnUrl%252525252525253D%25252525252525252FAccount%25252525252525252FLogin%25252525252525253FReturnUrl%25252525252525253D%2525252525252525252FAccount%2525252525252525252FLogin%2525252525252525253FReturnUrl%2525252525252525253D%252525252525252525252FAccount%252525252525252525252FLogin%252525252525252525253FReturnUrl%252525252525252525253D%25252525252525252525252FAccount%25252525252525252525252FLogin%25252525252525252525253FReturnUrl%25252525252525252525253D%2525252525252525252525252FAccount%2525252525252525252525252FLogin%2525252525252525252525253FReturnUrl%2525252525252525252525253D%252525252525252525252525252FAccount%252525252525252525252525252FLogin%252525252525252525252525253FReturnUrl%252525252525252525252525253D%25252525252525252525252525252FAccount%25252525252525252525252525252FLogin%25252525252525252525252525253FReturnUrl%25252525252525252525252525253D%2525252525252525252525252525252FAccount%2525252525252525252525252525252FLogin%2525252525252525252525252525253FReturnUrl%2525252525252525252525252525253D%252525252525252525252525252525252FAccount%252525252525252525252525252525252FLogin%252525252525252525252525252525253FReturnUrl%252525252525252525252525252525253D%25252525252525252525252525252525252FAccount%25252525252525252525252525252525252FLogin%25252525252525252525252525252525253FReturnUrl%25252525252525252525252525252525253D%2525252525252525252525252525252525252FAccount%2525252525252525252525252525252525252FLogin%2525252525252525252525252525252525253FReturnUrl%2525252525252525252525252525252525253D%252525252525252525252525252525252525252FAccount%252525252525252525252525252525252525252FLogin
Detailed Error Information:
Module    RequestFilteringModule
Notification    BeginRequest
Handler    ExtensionlessUrlHandler-Integrated-4.0
Error Code    0x00000000
I've used the exact same settings when referring to ReturnUrl in all methods.
For the most part, my applications' original AccountController and related security code was untouched from the original template.
My newer sample application runs fine on my local machine, so I’m not sure where the differences are.
I've seen posts suggesting that IIS Express configuration is to blame, but I've followed the cleanup advice, and also published to an Azure site with the same result.
I've been spending a lot of time trying to resolve this and haven't had any success so I thought I'd put it out there for some advice… thanks in advance for any & all help. Please let me know if you need to see more code.
I think your login action is missing [AllowAnonymous] attribute.
Do you have SSL setup locally?
Are authenticating on HTTPS then being redirected to HTTP which is killing the cookie & redirecting back to the HTTPS login page
Have you got something in the web.config for forms authentication redirect like
protection="All" requireSSL="true" loginUrl="~/Account/Login.aspx"
Do your cookies look ok?
Resolved... turns out the culprit was my Unity DI configuration.
I drilled deep to find the errors getting recursively thrown on each redirect, and it suggested the AccountController dependencies weren't being instantiated. I had a similiar issue last year Unity Container trying to resolve non registered type, throwing error , and so I looked further into the changed dependencies.
Following the suggested answer at Register IAuthenticationManager with Unity resolved the issue.
Thanks for the suggestions re: SSL / HTTPS / Filters, investigating these led me to the exceptions.
I also face this same issue before and solve by adding this line in web config
<add key="owin:AutomaticAppStartup" value="false"/>
It will disable OWIN startup discovery.
I hope it will work.
Also check in the IIS virtual directory. Check that anonymous user is enable or not, if disabled then enable it and problem will be solved.

ASP.Net MVC Controller causing Not Found error when deployed to IIS 7

I am developing a website using ASP.Net MVC. I have a method in the Home controller which returns a partial view when called. The issue is when I am calling the controller method using jQuery, I get a 404 Not Found error.
This only happens when the application is deployed on IIS 7. It works fine during development, but after deployement, none of the controller are found when called through jQuery.get method or post.
Thanking you all in advance for helping me.
I had the same problem. The simple fix for me was to do a aspnet_regiis -r
is the error an asp.net error (yellow and red) or the default iis7 html error? if its iis7 default error, make sure IIS7 has asp.net installed, that caught me out when i first started working with it. (programs and features and add windows components and make sure asp.net is selected under IIS)
Actually, the website is running, I can navigate among pages, only if there is a call through jQuery.get or post methods, then the error occurs. I guess, there is an issue with ISS 7 regarding recognizing that its a controller method. The error text is given below.
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable .
Thanks.
Make sure you have ASP.NET MVC installed and running. Also, make sure that your application is installed properly with appropriate references.
Like Tony says above, make sure you can actually access the complete URI (controller/method) in a browser to see if it works ok.
what is the URL that the jQuery.get method is accessing?
If it does, check how you have wired your Ajax call.
Do the method in your code have the AcceptVerbs attribute defined? [AcceptVerbs(HttpVerbs.Post)]
If you are deploying your mvc app as a virtual web make sure that BOTH your virtual web and the root site has its Application Pool set as Integrated Pipeline.
If you are running ASP.NET MVC on IIS7, make sure you configure IIS to run in "Integrated Pipeline Mode" as opposed to "Classic". You'll have more success with routing in this mode. More here.
I had same problem.
solved issue by changing the ajax url.
Just for an example ,
if you are using ajax call to the controller:
have to write url as like this == url: '#Url.Action("actionmethod", "controller")',
instead of ===== url: '/controller/actionmethod',
Thanks

asp.net routing with web forms--all routs get a 404

I have created a web forms app that implements routing. My applications utilizes Phil Haack's example (http://haacked.com/archive/2008/03/11/using-routing-with-webforms.aspx). All of my routes receive a 404 error. Any ideas?
Thanks
Which version of IIS are you running?
If you are using IIS6 you have some extra work to do, like enabling wildcards for all extensions.
Also, double check your web.config. There are a TON of changes that have to be made for that to work.

ASP.NET Forms Authentication - Logging off

How exactly can one implement a Log off function when using ASP.NET Forms Authentication on an intranet application?
How will this work if I am an administrator and want to log in "as someone else" into the application?
Please share your ideas
FormsAuthentication.SignOut(); ;)
The preferred authentication for an intranet application is to use windows authentication instead of forms authentication.
In which case you can just log off of windows and login as "someone" else.
Don't forget to also add Session.Abandon() to ensure session data is purged as well

Resources