-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NTM Authentication not working in .Net 5 #49434
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsDescriptionNTM Auth is not working in .Net 5. Ntlm auth works with on .Net Core 3.1 with CredentialCache and AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", false); We use Net Core running on Azure AKS to talk to Windows Servers with NTLM auth. Password based SPNEGO was not tested. Configuration
ReproInfoCreating new ticket as an addition to #887 as suggested by @wfurt here. Here's the table showing graphically what's going on:
|
This switch doesn't exist in .NET 5.0. The |
Do you have gss-ntlmssp installed @marcino239 That is prerequisite for Linux. What failure do you get? Can you post exception? e.g. does it fail to authenticate and you get HTTP 40x or do you get any other errors? |
How about forcing HttpClient to use HTTP/1.1? In your test code: var httpRequest = new HttpRequestMessage()
{
Method = HttpMethod.Get,
RequestUri = new Uri(url),
+ Version = new Version(1, 1)
}; |
Triage: we should look into it. |
I'm having the same issue:
example code snip var httpClient= new RestClient("uri")
{
Authenticator = new NtlmAuthenticator("username", "password")
};
httpClient.Execute(...); |
What is NtlmAuthenticator @alexirion10? Can you post simple HttpClient repro with container? If not at least do packet capture. |
var uri = new Uri("http://.........");
var networkCreds = new NetworkCredential("username", "password");
var credentialsCache = new CredentialCache { { uri, "NTLM", networkCreds } };
var handler = new HttpClientHandler { Credentials = credentialsCache };
var httpClient = new HttpClient(handler) { BaseAddress = uri };
var response = httpClient.GetAsync(".....").Result;
return response.Content.ReadAsStream(); |
Yah, the should work. We will need some more info or repro to diagnose @alexirion10. |
note if you don't want to share data here, send email to my GH address @alexirion10 |
Closing as there is not enough data to make it actionable. Feel free to reopen if/when there is something we can work with. Thanks! |
Description
NTM Auth is not working in .Net 5. Ntlm auth works with on .Net Core 3.1 with CredentialCache and AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", false);
We use Net Core running on Azure AKS to talk to Windows Servers with NTLM auth. Password based SPNEGO was not tested.
Configuration
Repro
testntlm by @JeroenBer
Info
Creating new ticket as an addition to #887 as suggested by @wfurt here. Here's the table showing graphically what's going on:
The text was updated successfully, but these errors were encountered: