microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.54k stars 897 forks source link

Connection error - multiple matching tokens detected #25813

Open KevinInKy opened 1 month ago

KevinInKy commented 1 month ago

Type: Bug

I can no longer log into any MS Sql Server using Azure Data Studio.

I get this error that tells me to clear token cache. I have no idea how to do that.

Failed to authenticate the user in Active Directory (Authentication=ActiveDirectoryInteractive). Error code 0xmultiple_matching_tokens_detected The cache contains multiple tokens satisfying the requirements. Try to clear token cache.

Azure Data Studio version: azuredatastudio 1.49.0 (6e6d22ddd74bbb4fbe344ed80b93b53489fe0239, 2024-08-01T05:19:02.202Z) OS version: Windows_NT x64 10.0.19045 Restricted Mode: No Preview Features: Enabled Modes:

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 1805)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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| |Load (avg)|undefined| |Memory (System)|31.39GB (13.84GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions: none
kburtram commented 1 month ago

Please try to clear the Azure Token Cache using the command in the Command Palette. Specifically,

  1. Click F1
  2. type something like clear
  3. Run the Clear Azure Token Cache entry.

image

KevinInKy commented 1 month ago

Please try to clear the Azure Token Cache using the command in the Command Palette. Specifically,

  1. Click F1
  2. type something like clear
  3. Run the Clear Azure Token Cache entry.

image

Thank you! This fixed my issue and I can log in again. Much appreciated.

RickMcDee commented 3 weeks ago

Had the same issue with 1.49.1. Clearing the cache worked for me, but very anoying bug

Commit: 2f696aa95a13ccabd7e0a4431d1d759e3a7b8cfd
Date: 2024-08-13T18:12:38.831Z
VS Code: 1.82.0
Electron: 25.9.8
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22631
e2ibrobbins commented 2 weeks ago

I also had the same issue using v1.49.0, and clearing the cache also helped me. Is this a new "feature"?

Matthewsre commented 2 weeks ago

Hit the same bug today, using 1.49.1

Solution above resolved it, but was not an intuitive flow since I had to find this to figure out how to clear the cache.

kburtram commented 2 weeks ago

The latest release contained a version update for the Azure.Identity (https://github.com/microsoft/sqltoolsservice/pull/2376). That component appears to be where this error is originating from. I'm not sure the details of why this is occurring specifically. Is this happening multiple times on the same machine? Or is it a one-time error requiring a token cache reset?

pettys commented 1 week ago

...Is this happening multiple times on the same machine? Or is it a one-time error requiring a token cache reset?

After clearing the token cache (per @KevinInKy) the error cleared. I'll update this comment if I experience it again in the next few days.