-
Notifications
You must be signed in to change notification settings - Fork 427
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 constrained delegation and connections pool. #607
Comments
Hello @krlm, the team is currently investigating this issue. We are having trouble replicating the exact problem you are encountering. You mentioned in your post about some repro code, and we were wondering if you could provide that to us to aid our investigation. |
Hi @rene-ye thanks for your reply. I've recreated the same issue with slightly modified code from mssql-jdbc example. It's available here: https://gist.github.com/krlm/410b480c0740e963ff68a3130048b769 |
Hi @krlm, the spring application won't be necessary as we have been able to reproduce the issue with the gist code you provided. A change to the driver has been proposed and is currently under review. While we review and test these changes, you can try them for yourself by cloning this branch, or downloading a compiled jar here: |
Hi @rene-ye thanks for providing patched version. It seems to work in my Spring Boot application and in mssql-jdbc example. Now I'm just wondering if it would be possible to simplify the way how credentials are passed to the connection. Using connection properties isn't a convenient way, especially when you'd like to utilize spring-data infrastructure (i.e. Thanks a lot for your time and provided fix, I hope that it will be available in official release soon. |
#636 has been merged and will be available starting from the next preview release. Closing the issue. |
Driver version or jar name
6.2.2-jre8
SQL Server version
2016
Client operating system
Linux, Ubuntu 18.04 (same problem on 16.10)
Java/JVM version
Java(TM) SE Runtime Environment (build 1.8.0_162-ea-b03), Oracle
Table schema
Not relevant, using
SELECT SYSTEM_USER
queryProblem description
I'm trying to use mssql-jdbc in a Spring boot application with Kerberos authentication. It works fine when I'm using unconstrained mode, (I guess it's because tickets are renewable then) but when I switch to constrained delegation mode then only first iteration of this loop is passing, next iteration is throwing following exception:
when I comment out fragments responsible for disposing credentials in mssql-jdbc, here and here it works fine, just like in unconstrained mode.
Expected behaviour and actual behaviour
Currently valid tickets (with init lifetime > 0) are disposed just right after the connection is established. I'd expect that valid Kerberos ticket can be reused for establishing connections inside connection pool, regardless it's constrained or unconstrained mode (I guess renewing them is a non-zero operation).
However, I'm not sure if it's right place to address this issue - I'm not from Java-land, just building some PoC - but I took ADO.NET SqlClient as reference which does handle impersonation and connection pooling.
Repro code
Will try to provide some small repro basing on mssql-jdbc constrained example later. (I guess adding a loop over connect method will result in the same issue, will check that).
The text was updated successfully, but these errors were encountered: