-
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
kerberos authentication in c# or Linux container #46945
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
@joperezr would S.DS.Protocols API's help here? |
Not really unfortunately. In DirectoryServices we don’t implement the kerberos protocol directly, but instead call a native library that handles the authentication for us, which internally uses and implements kerberos. We do have an internal implementation of Kerberos which we use in System.Net.Http which @davidsh wrote but this isn’t publicly available (I believe ASP.Net uses it too, but via reflection). There was a plan to expose that publicly but I believe @davidsh was still working on the design, I’ll try to find the issue and reference it from here. Other than that, I have seen third party implementations which are fairly complete, like one called Kerberos.Net. |
The issue I was thinking of is this one: #29270 The internal class we have today that knows how to perform Kerberos authentication is called NTAuthentication. |
There is NegotiateStream for anybody who needs Kerberos. I don't know if there is good way how to hook it in. I guess in worst case, you would need to create the authenticated Stream and then tunnel SQL through that. |
Is there any way this can be achieved?
|
the problem is that even with impresonification, you need credentials in you app @sudominmonk. If I understand @hameedshk correctly the concern is about credential management. AFAIK there are only two ways: authenticate with OS and use "DefaultCredentails" at .NET e.g. inherit your identity from OS or use explicit authentication, credentiasl and identity inside .NET. |
@wfurt in simple words what I am trying to achieve is like windows authentication in Unix based server . Windows authentication authenticate the application via ldap protocol against directory services of course with proper credentials. I am trying to authenticate the credentials against AD and then connect to ms sql server . |
Ok. So you DO want your app to manage credentials. In that case I'm perhaps confused by the " But via username and password is a bad practice" note. |
#69920 was approved and should be done in 7.0. hat should allow some progress but I'm not sure how the managed API would interact with native bits. |
How to achieve kerberos authentication in dotnet core independent of underlying Linux or windows operating system?
Description
What I am looking or trying to achieve is when the application runs in Linux dotnet core ,I need to first authenticate the credentials in Active directory and then connect to SQL sever and fetch the data.
Configuration
The text was updated successfully, but these errors were encountered: