-
Notifications
You must be signed in to change notification settings - Fork 465
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
Preview support for Integrated Authentication on Mac is not working #985
Comments
Sorry I needed to edit because I copy - pasted the title from the release notes and the truth is that I can't claim it is not working on linux. I have only tested it on my mac. |
@TVScoundrel the Integration Authentication support is handled within the .Net Core SqlClient component. I've reached out to the owner for that component on what information we could collect that would help us troubleshoot this issue. I'll let you know once I hear back. |
Thanks @kburtram, yes I seem to have found an open issue at dotnet/corefx here: https://github.com/dotnet/corefx/issues/22463 |
@TVScoundrel I contacted the SqlClient owner and he will look at the corefx issue you've mentioned. I'll let you know if there is any update or more information needed to troubleshoot. Thanks! |
@TVScoundrel @geleems asked the following questions regarding your configuration. Please let me know if the questions need clarification. Can you please verify if the user used setup SQL Server SPN with correct FQDN? |
@TVScoundrel
If so, the exception was thrown here: |
I would not know where to get this stack trace from, I am just trying to connect from within vcode using the connection setup, I have no idea how to debug this. |
As far as the |
@TVScoundrel We need 2 pieces of information to take this further.
|
Do you have the following two lines in your
The first is required to enable GSSAPI (Kerberos) authentication, the second one is required to get ssh to canonicalize the hostname via DNS and use the canonical name to obtain a host service ticket. Without the second one, ssh will use the exact hostname or IP address entered on the command line to try and obtain a host service ticket, and in this case it fails. |
@TVScoundrel |
It seems I have the same problem as @TVScoundrel. @geleems : Adding those entries to ~/.ssh/config file didn't do the trick. @saurabh500 : In answer to your second question, I've tried using just the CN, the FQDN and now the somegrouping/machinename.DC.DC.DC. None of those attempts were successful. The stacktrace is the same as the one posted above for all attempts, except for the grouping/machinename.DC.DC.DC, which gave an: |
I also have the same issue, i tried all above mention solution, still not able to connect using Integrated authentication. any pointers |
@geleems Though my previous issue was resolved. It seems that it's returned when attempting to connected to a different SQL server. The one that worked is SQL 2016 (13.0.4446.0). The one I tried to connect to today is SQL 2012 (11.0.6607.3). The output window says:
I did verify that my ~/.ssh/config still exists and I can still connect to the 2016 server. |
I am also trying to connect Sql 2016 getting below exception, Any pointers?
|
I am getting exactly the same error as @TVScoundrel and @VimalKumarS |
Folks getting the exception while connecting to sql server inspite of having retrieved the correct kerberos token using You could start by checking if Sql Server host has a SPN registered with the SQL Server. You could log in to the Sql Server host machine (if Sql is hosted on Windows) and use the command In case you cannot access the Sql Server host machine, you could also query this from another Windows Machine by using the command |
Thanks @saurabh500 I can confirm this works. Ran the following command on my SQL Server:
For username I used the same name that is running the SQL Server Service. I hope it is correct and does not have any security impact. Thanks! |
No, that shouldn't have an impact. In fact the username in the setspn command is used to see if the user has permissions to add an SPN record to the AD. Thanks for the confirmation @Code-DJ |
@saurabh500 |
@VimalKumarS you may need to work with your AD administrators to get this done. |
I was able to confirm that SQL servers with Kerberos configured could be connected to but without could not be connected. I was not able to adjust the Kerberos settings as the machines are locked down, but I suspect it would fix the issue. |
Guys we seem to be having the same issue from within .net core 2.0 sql client from a linux docker container. Out sql server is definitely kerberos enabled but the spn is not set at the computer name. It is set to a service account instead. This definitely looks like an oversight in the sqlclient that's why some people have success (spn is computer name) and some don't (spn is svc account). We need to somehow get the right people involved to fix this in sqlclient or System.Net.Security. |
simply i got the same error for .net core 2.0 sql client from a linux docker container.
just change your connection string to this will use SQL authentication instead of Integrated Authentication |
Found a resolution to configuring SQL Servers with Kerberos. There is a tool |
Hello Team , I am trying to connect to SQL server fro my .net core app from PCF. Its works fine when I use username and password. But Unable to configure Windows authentication. Can someone please help exception I get |
@sapnamc PCF...Pivotal Cloud Foundry?
|
@carlowahlstedt . Yes I I used my windows Credentials . my connection string Did you follow the Kerberos setup instructions? Yes . This is Done by DBA 3: Did you do what was mentioned in the above comment Thanks for replying |
Since this is the only open ticket. I tried running it on my mac.
But no luck, i followed all the steps, checked kinit, have a correct kerberos ticket. I can log on to other services via kerberos and i have a windows laptop on which i can correct to it just fine with sql studio using the same credentials. Tried with the default port, tried with using ,1433 (comma etc) |
Took a stab at it again. If anyone has some other ideas, i use a tunnel to connecto to it. But i opened the tunnel from outside of my mac. Connected to it from a windows machine and it works. So i know my connection is valid and allows credentials to go through. Just not locally from my mac. Also using 'nomad' which does kerberos for me. In the end i used the ticket viewer to make sure i had the correct AD account but no luck. I do notice i have different error message if i remove my krb5.conf (since i use nomad it still has a ticket) googled that message "unknown mech-code 0 for mech unknown" which at some point someone said he gets that message if he has no valid ticket. So mine is not picked up somehow. |
I had the same exact issue on mac and was able to successfully use kerberos along with unixodbc to verify that I could use kerberos to authenticate against sql server. The solution was actually insanely simple for me and I really hope it is for some of you having this issue. When you go to connect and it asks for your server name, host name, I was originally entering: After hours of trying, the solution for me was to simply put a comma and the port after the server name. Maybe this is a pretty "well, duh" fix, but somehow never tried that. Anyways, let me know if this helps anyone! |
Closing as integrated auth on mac is supported. |
Preview support for Integrated Authentication (aka Windows Authentication) on Mac is not working. I have a confirmed kerberos ticket but vscode can't access it.
The text was updated successfully, but these errors were encountered: