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

Connect MSSQL using Windows Authentication #236

Closed
codegrean opened this issue Nov 5, 2015 · 3 comments
Closed

Connect MSSQL using Windows Authentication #236

codegrean opened this issue Nov 5, 2015 · 3 comments

Comments

@codegrean
Copy link

I have a problem with connecting MSSQL server using Windows Authentication. This is my code:

con = TinyTds::Client.new(:username => 'GLOBAL\username', :host => 'MYHOST', :database => 'MYDB')

In freetds.conf

[MYHOST]
        host = 123.45.6.7
        port = 1433
TinyTds::Error: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
  from /home/foobar/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/tiny_tds-0.6.2/lib/tiny_tds/client.rb:77:in `connect'
  from /home/foobar/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/tiny_tds-0.6.2/lib/tiny_tds/client.rb:77:in `initialize'
  from (irb):4:in `new'
  from (irb):4
  from /home/foobar/.rbenv/versions/2.1.5/bin/irb:11:in `<main>'

Are options correct? Anyone have any ideas on how to fix?
Thanks

@metaskills
Copy link
Member

This is a duplicate of #221. Windows authentication is not supported in FreeTDS yet.

@larskanis
Copy link
Member

Kerberos authentication should work since FreeTDS-9.1 according to the NEWS file . But the computer must be joined to the domain of the SQL-Server, see FreeTDS documentation. Even if Microsoft calls this Windows authentication, it isn't limited to Windows by any means. I use this kind of SSO with our PostgreSQL servers and clients cross platform since years. But this is not the same as Azure Active Directory Authentication.

@zhongxiao37
Copy link

The error message says you were doing things cross domain, which is not allowed. You need to use credentional manager to get it resolved. Try this doc: https://www.mssqltips.com/sqlservertip/3250/connect-to-sql-servers-in-another-domain-using-windows-authentication/. However, I don't have this problem on Mac even I'm on other domains.

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

No branches or pull requests

4 participants