# Logstash JDBC to MSSQL - this driver is not configured for integrated authentication

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-to-mssql-this-driver-is-not-configured-for-integrated-authentication/222674>\
**Category:** Logstash\
**Created:** [March 9, 2020, 9:31am UTC](https://discuss.elastic.co/t/logstash-jdbc-to-mssql-this-driver-is-not-configured-for-integrated-authentication/222674 "2020-03-09T09:31:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mattness](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattness/32/52975_2.png) [@Mattness](https://discuss.elastic.co/u/Mattness)\
**Post date:** [March 9, 2020, 9:31am UTC](https://discuss.elastic.co/t/logstash-jdbc-to-mssql-this-driver-is-not-configured-for-integrated-authentication/222674/1 "2020-03-09T09:31:56Z")

</div>

Hello,

I am trying to connect logstash to my sql server 2019.

My .conf file:

input {  
jdbc {  
jdbc\_driver\_library =\> "C:/sqljdbc\_8.2/enu/mssql-jdbc-8.2.0.jre13.jar"  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
jdbc\_connection\_string =\> "jdbc:sqlserver://SERVERNAME:1433;databasename=DBNAME;integratedSecurity=true"  
jdbc\_user =\> "MYDOMAIN\USER"  
jdbc\_password =\> "\*\*\*_"  
 #parameters =\> { "" }  
schedule =\> "_ \* \* \* \*"  
statement =\> "SELECT TOP (1000) [optname]  
,[value]  
,[major\_version]  
,[minor\_version]  
,[revision]  
,[install\_failures]  
FROM [master].[dbo].[MSreplication\_options]"  
}  
}

output { stdout {} }

I recevie this Error Message:

[2020-03-09T09:53:14,801][ERROR][logstash.inputs.jdbc] Unable to connect to database. Tried 1 times {:error\_message=\>"Java::ComMicrosoftSqlserverJdbc::SQLServerException: This driver is not configured for integrated security"}

So far I have tried to add the mssql-jdbc\_auth-8.2.0.x64.dll to the  
java.library path, the system PATH variable, the Java/JDK/bin directory and the Java/JDK/library directory. This changed nothing for me.

I also tried many different connection strings and both modes for server authentication (windows-authentication & Sql Server AND windows-authentication)

That just resulted in slightly different ErrorLogs, namely:

Login failed for user 'MYDOMAIN\USER'. Reason: An attempt to login using SQL authentication failed. Server is configured for Integrated authentication only.

AND

Login failed for user 'MYDOMAIN\USER'. Reason: Attempting to use an NT account name with SQL Server Authentication. [CLIENT: \*\*\*\*\*\*]

Can someone please help me out?

---

<div class="post-metadata">

**Author:** ![ITIC](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@ITIC](https://discuss.elastic.co/u/ITIC)\
**Post date:** [March 9, 2020, 10:10am UTC](https://discuss.elastic.co/t/logstash-jdbc-to-mssql-this-driver-is-not-configured-for-integrated-authentication/222674/2 "2020-03-09T10:10:03Z")

</div>

HI

If you are getting `login failed` errors I'd say you have your plugin properly configured and it is reaching the server, and there's a problem with your credentials and/or connection string.

Try adding `sql_log_level => "debug"` to your `jdbc{}` configuration, and see if you get more detailed information.

If you are trying to use a local SQL user, have you tried with `jdbc_user => "USER"`, without the domain? What did you get?

Have you tried without the `integratedSecurity=true`parameter? What did you get?

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Mattness](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattness/32/52975_2.png) [@Mattness](https://discuss.elastic.co/u/Mattness)\
**Post date:** [March 9, 2020, 10:21am UTC](https://discuss.elastic.co/t/logstash-jdbc-to-mssql-this-driver-is-not-configured-for-integrated-authentication/222674/3 "2020-03-09T10:21:22Z")

</div>

Hi,

in the end I succeeded with the mixed authentication mode.  
I created a basic SQL user in the management studio & used "Trusted\_Connection=True;" in the .conf file.  
for jdbc.user & password I used the credentials I defined via management studio.

Thanks for you effort 🙂 I will try your suggestions in addition to my solution.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 6, 2020, 10:21am UTC](https://discuss.elastic.co/t/logstash-jdbc-to-mssql-this-driver-is-not-configured-for-integrated-authentication/222674/4 "2020-04-06T10:21:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
