-
Notifications
You must be signed in to change notification settings - Fork 906
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
Connection Error using MFA #24340
Comments
Hi @vikarBCC As the error suggests, have you tried refreshing your account or adding it again? |
Hi @cheenamalhotra, |
I'm experiencing what I think is the same issue on v1.46.1 on Windows. I agree that deleting cached tokens then refreshing accounts doesn't always work (at this stage ADS gives |
I would recommend the same to clear |
Hi, Any update on the progress of this issue? |
Any permanent solutions to this issue? Clearing cache or removing/readding accounts isn't a great user experience. |
I ran into this as well, and the usual fixes weren't working at all. I had first tried deleting all cached logins, accounts, re-adding accounts, deleting cache and cookies in Chrome, reinstalling Azure Data Studio, etc. etc. Nothing worked. The only thing that ended up fixing it is when I pasted the reauthentication URL into a different browser:
But no idea whether it's due to Chrome, my settings, or how Chrome talks to Azure Data Studio, or due to Edge. But if you run into these reauthentication issues, perhaps try different browsers or an incognito window. But the behavior that I'm ending up with is still odd. For any other program that I use to connect to our SQL server with MFA, I need to go through actual, proper MFA, with an authenticator app. For Azure Data Studio, it hijacks the login from your browser, skips the MFA, and then you're just logged in? When I restart ADS, it even skips the browser step now. I mean, sure, it's convenient, but I can't help but think that's the source of all these problems, and practically it's like there's no real MFA at all. So, basically, like Chris says; why not use the standard MS login workflow? |
We have the same problem but it appears to be totally random. 6 people with fresh installations, all try to make a connection to a SQL database in Synapse for the first time following the same instructions to connect via Microsoft Entra. 3 successful, 3 failed. All get confirmation in browser that authentication is successful, but the receive message in ADS: But ADS never triggers the full multi-factor authentication process. Any reply from Microsoft on this issue? |
Same here, we have several users from the same network and configurations and only some are experiencing this issue. I see the same issue here #17356 and here microsoft/vscode-mssql#17234. We get a redirect to localhost:xxxx, then login.microsoftonline.com where the user logs in and it keeps on loading where it does not progress from there. |
Type: Bug
Microsoft.Data.SqlClient.SqlException (0x80131904): Failed to authenticate the user in Active Directory (Authentication=ActiveDirectoryInteractive).
Error code 0xinvalid_grant
AADSTS50078: Presented multi-factor authentication has expired due to policies configured by your administrator, you must refresh your multi-factor authentication to access '022907d3-0f1b-48f7-badc-1ba6abab6d66'.
Trace ID: 84d108ea-0e5e-4bb4-b076-45474aae0200
Correlation ID: db68ebfb-a6ed-492d-bd3c-3845885d9882
Timestamp: 2023-09-08 05:15:01Z
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.GetFedAuthToken(SqlFedAuthInfo fedAuthInfo)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OnFedAuthInfo(SqlFedAuthInfo fedAuthInfo)
at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)
at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at Microsoft.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
at Microsoft.Data.ProviderBase.DbConnectionFactory.<>c__DisplayClass48_0.b__0(Task
1 _) at System.Threading.Tasks.ContinuationResultTaskFromResultTask
2.InnerInvoke()at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection.ReliableSqlConnection.<>c__DisplayClass30_0.<b__0>d.MoveNext() in //src/Microsoft.SqlTools.ManagedBatchParser/ReliableConnection/ReliableSqlConnection.cs:line 313
--- End of stack trace from previous location ---
at Microsoft.SqlTools.ServiceLayer.Connection.ConnectionService.TryOpenConnection(ConnectionInfo connectionInfo, ConnectParams connectionParams) in //src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs:line 711
ClientConnectionId:1a28d02a-60b3-4aad-83c7-c0aec24ae4d5
Azure Data Studio version: azuredatastudio 1.45.1 (88c21b1, 2023-08-03T00:42:37.945Z)
OS version: Windows_NT x64 10.0.19044
Restricted Mode: No
Preview Features: Disabled
Modes:
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Extensions (23)
The text was updated successfully, but these errors were encountered: