简体   繁体   中英

Suddenly getting: The HTTP request is unauthorized with client authentication scheme 'Negotiate'

During a debugging session of a dotnet framework application I started getting:

The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLM,Basic realm=...

after launching the web project successfully for hours on IIS.

My .vs/{solutionName}/config/applicationhost.config has windows auth with negotiate:

<windowsAuthentication enabled="true">
    <providers>
           <add value="Negotiate" />
           <add value="NTLM" />
    </providers>
</windowsAuthentication>

Excatly the same settings for IIS:

C:\\Program Files (x86)\\IIS Express\\AppServer\\applicationhost.config

What could have happened to cause me to suddenly get this error?

i have tried clearing the cache for ie, but that did not work

Edit: I tried deleting the repo locally and cloning from remote, but this did not solve the issue, so there must be some local configuration outside of the repo that is causing this

This was quite the edge case.

I had attempted to login to a web app, let's call it "BT", with incorrect credentials. This caused Credential Manager on Windows to create a Windows credential for BT with the wrong username+password combination.

The project I am working on authorizes towards BT during launch which resulted in the error. I do not understand how, but apparently the credentials in Credential Manager were used instead of the default "use the logged in users credentials". The solution in my case was to modify/delete the windows credential in the Credential Manager

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM