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

SNOW-1566207: ExternalBrowser authentication hangs if user closes browser prior to authentication #1849

Closed
hchenatsafe opened this issue Jul 30, 2024 · 3 comments
Assignees
Labels
bug status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. status-merged

Comments

@hchenatsafe
Copy link

1. What version of JDBC driver are you using?
3.16.1

2. What operating system and processor architecture are you using?
Ubuntu 22.04, Intel x64

3. What version of Java are you using?
OpenJDK 17.0.11+9
OpenJ9 0.44.0

4. What did you do?
Our application allows users to pass the connection property authenticator=externalbrowser when we connect to the driver via connect().

This works fine if the user logs in successfully, but if the user decides to close the browser without logging in, the request simply hangs and does not return any exceptions or timeouts.

5. What did you expect to see?

A similar browser-based authentication method exists for the Microsoft JDBC Driver for SQL Server. When the user closes the browser without logging in, the driver returns an exception after a short amount of time:

Worker 3430810 > com.microsoft.sqlserver.jdbc.SQLServerException: Failed to authenticate the user test@test.com in Active Directory (Authentication=ActiveDirectoryInteractive). No Authorization code was returned from the server
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerMSAL4JUtils.getCorrectedException(SQLServerMSAL4JUtils.java:449)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerMSAL4JUtils.getSqlFedAuthTokenInteractive(SQLServerMSAL4JUtils.java:403)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerConnection.getFedAuthToken(SQLServerConnection.java:6157)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerConnection.onFedAuthInfo(SQLServerConnection.java:5989)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerConnection.processFedAuthInfo(SQLServerConnection.java:5823)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onFedAuthInfo(tdsparser.java:322)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:130)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:42)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:6881)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:5428)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$300(SQLServerConnection.java:94)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:5360)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7748)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:4410)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:3847)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:3372)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:3197)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1971)
Worker 3430810 > at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1263)

@github-actions github-actions bot changed the title ExternalBrowser authentication hangs if user closes browser prior to authentication SNOW-1566207: ExternalBrowser authentication hangs if user closes browser prior to authentication Jul 30, 2024
@sfc-gh-wfateem sfc-gh-wfateem self-assigned this Jul 31, 2024
@sfc-gh-wfateem sfc-gh-wfateem added status-merged status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. labels Jul 31, 2024
@sfc-gh-wfateem
Copy link
Collaborator

Hi @hchenatsafe,
Thanks for reaching out. PR #1824 addresses this issue and has already been merged. We'll update the issue once it's released.

@hchenatsafe
Copy link
Author

Oh that's awesome, thank you!

@sfc-gh-dszmolka
Copy link
Contributor

Released with JDBC v3.19.0 in August 2024 release cycle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. status-merged
Projects
None yet
Development

No branches or pull requests

3 participants