-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
SmtpClient NTLM and Kerberos testing #19436
Comments
Testing this would require Nego infrastructure (Active Directory, a SMTP server that understands NTLM/Kerberos, etc). |
Triage: This will likely fall out of @davidsh's enterprise scenarios testing effort which is under way. |
In the prototype branch for issue #70909 I added a test that runs against the fake Negotiate / NTLM server inside the loopback server. Obviously that's not going to cover Kerberos but it seems like an easiest path to get some coverage for the authentication code paths. |
@jborean93 created a proof-of-concept for testing against custom local KDC much like we already do on Linux/macOS - https://github.com/jborean93/LocalKdc. Unlike the Unix-based system it needs admin access to run but that's still way better than needing separate infrastructure or restarting the machine. Do we have some outerloop test infrastructure that is run with admin rights? I am looking for some prior art. Even if we can make this working only for local testing it would be a huge improvement. /cc @wfurt |
Turns out, with fixed realm and 4 DNS records I can make this work as non-admin too: https://github.com/filipnavara/LocalKdc/pull/new/filipnavara-dev I setup the following DNS records to point to localhost:
|
@SteveSyfuhs I know this is a long shot but is there any way at all to replicate how a domain joined computer account gets its ticket for authentication? I’m hoping there is so we can test out the acceptor/inbound context through SSPI with something like the local KDC setup. I know there is an auth package to list/purge tickets as exposed through |
Looks like it is possible with an undocumented credential type Definitely not documented but it could be worthwhile for testing purposes. Also credit to James Forshaw for pointing out that example from Steve’s delegation repo. |
|
Is is possible to have this documented officially, would love to use it officially in some of my libraries that call SSPI.
Thanks for the info. Does that mean theoretically I could just provide in the Edit: Just tested that and it does not work, the |
You will also have to disable PAC validation since your KDC doesn't have a netlogon endpoint. You will have to run as SYSTEM still though. Ultimately your approach works fine and it might be less hassle in the long run since you don't have to deal with key normalization. |
Per offline SCRUM discussion: add e2e NTLM/Kerberos testing for SmtpClient authentication.
Example:
https://github.com/dotnet/corefx/blob/master/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamKerberosTest.cs
/cc: @karelz @Priya91
The text was updated successfully, but these errors were encountered: