How does the SQL Server JDBC Trusted Connection Authentication work?

[亡魂溺海] 提交于 2019-12-25 01:46:45

问题


How does the SQL Server JDBC Trusted Connection Authentication work? (ie how does the trusted connection authenticate the logged in AD user in such a transparent and elegant fashion and how can I implement a similar authentication solution for my client-server applications in Java without a database connection or any use of the existing SQL Server solution.)

Assumptions * Working within a Windows 2003 domain * You have access to the Windows API via JNI/JNA


回答1:


It depends on the client. For example if you have a Web Browser, it can use the NTLM Authentication to pass the domain authentication of your current client to the server. In this case the browser like IE or FF supports this, and you web server needs the support for NTLM. For example here for Tomcat: http://jcifs.samba.org/src/docs/ntlmhttpauth.html

There is also the SPNEGO protcol in combination with Kerberos, as explained here: http://java.sun.com/javase/6/docs/technotes/guides/security/jgss/lab/index.html

If you have your own client, it depends on the client's framework if it is able to use the local user's security context and is able to pass it on. The page above describes this at least for a kerberos scenario.

Greetings Bernd

PS: I am not sure if you can pass the authentication context established with the jcifs/ntmlm solution to a backend component like SQL Server. It should work with Kerberos tickets (if configured).




回答2:


jTDS and Microsoft JDBC Driver both offer native Windows Authentication.




回答3:


Have you looked at this question? The situation seems to be similar to yours (connecting to a SQL Server database using Windows authentication).



来源:https://stackoverflow.com/questions/221149/how-does-the-sql-server-jdbc-trusted-connection-authentication-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!