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

Fix SSO with instance name instead of port #129

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ununnilium
Copy link

When a named instance instead of a port is used, Kerberos logins failed because the spn string was
"MSSQLSvc@SERVER_NAME:None" instead of "MSSQLSvc@SERVER_NAME:INSTANCE_NAME".
When "port" is None (parsed_servers[0][1]), "instance" (parsed_servers[0][2]) should be used.

When a named instance instead of a port is used, Kerberos logins failed because the spn string was
 "MSSQLSvc@SERVER_NAME:None" instead of "MSSQLSvc@SERVER_NAME:INSTANCE_NAME".
@codecov
Copy link

codecov bot commented Jan 4, 2022

Codecov Report

Merging #129 (53424af) into master (7c73812) will decrease coverage by 1.79%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #129      +/-   ##
==========================================
- Coverage   93.58%   91.79%   -1.80%     
==========================================
  Files          28       27       -1     
  Lines        7947     7736     -211     
==========================================
- Hits         7437     7101     -336     
- Misses        510      635     +125     
Impacted Files Coverage Δ
src/pytds/__init__.py 91.49% <100.00%> (-0.94%) ⬇️
src/pytds/tls.py 18.64% <0.00%> (-74.58%) ⬇️
tests/fixtures.py 93.33% <0.00%> (-6.67%) ⬇️
tests/unit_test.py 94.10% <0.00%> (-4.98%) ⬇️
tests/utils.py 81.13% <0.00%> (-1.89%) ⬇️
src/pytds/tds_base.py 93.65% <0.00%> (-1.47%) ⬇️
src/pytds/tds.py 95.90% <0.00%> (-0.63%) ⬇️
tests/connected_test.py 97.53% <0.00%> (-0.62%) ⬇️
tests/all_test.py 94.92% <0.00%> (-0.14%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c73812...53424af. Read the comment docs.

This fixes the following error:
kerberos.GSSError: (('Unspecified GSS failure.  Minor code
may provide more information', 851968), ('Server not found
in Kerberos database', -1765328377))
@denisenkom
Copy link
Owner

Why do you need to use socket.getfqdn, you did not explain that in the description

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

Successfully merging this pull request may close these issues.

2 participants