2

I am trying to connect to a SQL Server 2012 Database using Hibernate 5. I am using the following connection string in order to connect to the database

jdbc:sqlserver://server;instanceName=instance;DatabaseName=database;integratedSecurity=true

As the database authentication is with Windows Credentials. However, my account has not access to it, so I need to use an application account which I have configured on Windows Credential Manager. When I connect to the database through Microsoft SQL Management Studio it works fine (it picks up the user and password from credential manager and log in to the database). But when I attempt to do it with the application it seems that it still using my primary account for authentication as it shows the following error:

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'SA\ezequiel.de-luca'. ClientConnectionId:b10e13ef-e400-4569-bb2e-be592e2d9872

I attempt to pass the credentials on the connection string, as follows

jdbc:sqlserver://server;instanceName=instance;DatabaseName=database;domain=domain;userName=user;password=passowrd

but it doesn´t work either. The same error appears, it only change the username on the exception message. Do you have any idea of how should I modify the connection string?

1 Answer 1

0

After months of investigation and Microsoft involved in the middle, we finally found the answer. On Windows 10 Creators editions there is a patch, that change the Windows Credential Manager. In order to work, credentials must be specified on the following way: internet or network address: fdqn:port usersname: user@domain Pre-Windows 2000 format does not work if the domain has more than one component Ex: contoso.com\user works, but contoso.msft.com\user does not work In Windows 10 Fall Creators Edition, it was fixed and you can use just the fqdn or server name on the internet or network address.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.