squirrel-sql-client / squirrel-sql-code

Share of the SQuirreL SQL source code originating from SourceForge, see https://squirrelsql.org
GNU Lesser General Public License v2.1
65 stars 12 forks source link

Please add support for MFA in MS SQL Server #3

Open Boris-Shrub opened 2 years ago

Boris-Shrub commented 2 years ago

I have tried using MFA. In driver properties set "authentication" = ActiveDirectoryInteractive. Added msal4j-1.7.1.jar into driver In the beginning it is working - it opened browser, I entered my user name and password, passed 2 factor auth. But then browser kept opening new tabs, but Squirrel just returned "timeout" exception.

gerdwagner commented 2 years ago

Sorry, that's hard to reproduce for me. You may try to increase the login timeout which by default is set to 30 seconds. See menu File --> Global Preferences --> tab SQL, right at the top.

If you or anybody else knowing some Java could provide a patch I'd appreciate it.

Boris-Shrub commented 1 year ago

I can reproduce, but not sure how I can help with this. Can you give me some basic directions about what I can do to help?

gerdwagner commented 1 year ago

Probably the simplest way to start is to create a plain Java class with a main method and then to use the plain JDBC API to connect to the database with "authentication" = ActiveDirectoryInteractive. This done, for a proof of concept, you may additionally execute a simple SQL statement through the connection you created.

When this works you may try to debug SQuirreL in an IDE like IntelliJ or Eclipse to see what's the difference of SQuirreL's way to access the database compared to your sample program. Build instructions and basic IDE setup information on SQuirreL can be found here: https://github.com/squirrel-sql-client/squirrel-sql-code

When you get the sample program to work you may also post it here and I'll have a look at it.