-
Notifications
You must be signed in to change notification settings - Fork 10.3k
NTLM support with Kestrel #14951
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
Comments
Not 100% sure, but can you try calling the AddNegotiate overload that takes an auth scheme? https://github.com/aspnet/AspNetCore/blob/master/src/Security/Authentication/Negotiate/src/NegotiateExtensions.cs#L41 And there you can pass in Negotiate,NTLM. @Tratcher to confirm. |
@jkotalik no, auth scheme is the internal identifier, not the header. |
https://github.com/aspnet/AspNetCore/blob/21c9e2cc954c10719878839cd3f766aca5f57b34/src/Security/Authentication/Negotiate/src/NegotiateHandler.cs#L359
FYI the new UseAuthorization middleware can replace your ValidateAuthentication middleware if you set the fallback policy to require auth. What client and scenario do you have that requires direct NTLM usage? |
Ok. Thanks @Tratcher If your support is only for Negotiate, and has only been verified on Linux, then I think your documentation is a little misleading. I understand from your reply that NTLM support from your side is about to end. We have a task in our organization then to move away from NTLM. |
We tested Windows too, but the windows support wasn't new functionality, that was already supported via other code paths.
NTLM will never go away completely, but you'd do best to avoid it. |
We don't have plans to add support for NTLM in Kestrel. If this kind of legacy support is necessary for you, there are still servers that support it (IIS and HttpSysServer). We have no plans to bring this legacy forward to Kestrel though. |
@anurse Only I still recommend that you revisit your documentation This is not correct:
|
Fair point. NTLM is, I believe, still supported on Windows because the native components we use support it. We should update that to indicate that we don't support NTLM on Linux. (At least that's my understanding, @Tratcher can confirm in the docs PR I'm about to open :)) |
CoreFx recently identified a bug that was preventing NTLM from working via Negotiate on Linux, they'll get that working at some point. The point at issue here is that NTLM is not directly supported on any platform because you can't make NTLM the auth header challenge, you can only use it as a Negotiate fallback. |
@anurse My understanding of NTLM, is that it is based on challange / response. I don't see how NTLM could work at all, if there is no challange? |
We were excited to see that NTLM and Negotiate are now supported in with Kestrel, as described here
https://docs.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth?view=aspnetcore-3.0&tabs=visual-studio
However we have only been able to make this work with Negotiate, not NTLM.
Basically we have done what is described in the above article.
Added authentication to services:
and added Authentication to the pipeline
We also have our own simple check for authorization in the pipeline
The ValidateAuthentication middleware is very simple:
When a challenge is sent, we only see Negotiate
We would have expected NTLM as well. Something like
Why is NTLM not supported by our Kestrel host as well?
The applications is tested on a Windows 10 machine in an enterprise environment using AD as identity system.
The text was updated successfully, but these errors were encountered: