Skip to content
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

Please add trusted_connection option #28

Closed
amachanic opened this issue Aug 24, 2018 · 7 comments
Closed

Please add trusted_connection option #28

amachanic opened this issue Aug 24, 2018 · 7 comments
Labels

Comments

@amachanic
Copy link

FreeTDS supports a connection option called trusted_connection that allows for SSPI or Kerberos based authentication. Any chance you can expose that?

Thanks!

@joshuahlang
Copy link
Collaborator

FreeTDS only exposes this option via ODBC and that prompts the user for input on Windows only (based on my skimming of the code). Unfortunately, ctds doesn't use the ODBC interface of FreeTDS.

@nickolay
Copy link
Contributor

Simply passing empty strings for the user and password parameters of ctds.connect() works for me, presumably using the "integrated security" (aka trusted_connection), that is re-using the domain credentials of the current Windows user.

I got the idea to try it after seeing this in FreeTDS code: https://github.com/FreeTDS/freetds/blob/0898c7e3eb2b41709f9ae38a15beaa1b6fab77c7/src/tds/login.c#L874

It could be added to the documentation, though, since it's an important feature for Windows-running shops.

@amachanic
Copy link
Author

amachanic commented Aug 30, 2018

@nickolay

Which OS did you do this on*, and can you describe more about the environment? On this end, Linux, after caching a Kerberos ticket using kinit, setting empty user and password results in:

_tds.OperationalError: Adaptive Server connection failed (server:1433)

*As an aside, I am not able to get CTDS to compile on Windows (thanks to FreeTDS). If you've been able to do that I'd love to get some decent instructions. I sank a few hours into the pursuit and got nowhere.

@nickolay
Copy link
Contributor

I’m on Windows 10, connecting to MSSQL2012. (I recently submitted #30 to document the solutions to the problems I encountered while attempting to build. FreeTDS itself compiled without an issue after I installed cmake and fixed the problem with Microsoft’s rc.exe missing from PATH.)

On Linux: If I were you, I’d try getting the FreeTDS command-line utility (tsql?) to connect first. I didn’t investigate Kerberos-specific instructions, since I was interested in Windows, but I saw some troubleshooting info in FreeTDS’ user guide.

@amachanic
Copy link
Author

@srprogrammer

Thanks for the reference. Unfortunately I can't seem to get it working in Linux using a cached ticket. I suspect that it's designed for Windows? Oh well! I'm giving up at this point.

@joshuahlang
Copy link
Collaborator

Closing as external

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants