为什么可以重新实现(MFA带有MSSQL扩展程序的MFA)?

发布于 2025-01-28 15:07:21 字数 1062 浏览 2 评论 0原文

这是已停止工作的连接配置的示例(它是用于连接到Azure托管数据库):

{
  "server": "sqldb.12345abcde.database.windows.net",
  "database": "sqldb01",
  "authenticationType": "AzureMFA",
  "profileName": "sqldb01",
  "azureAccountToken": "",
  "expiresOn": 1648022420,
  "email": "[email protected]",
  "accountId": "aaaaaaaa-0000-bbbb-1111-cccccc222222"
}

当我尝试连接时,VS代码显示对话框,说MSSQL:凭据错误:帐户凭据已过期。请重新授权。和另一个说法mssql:undefined

<< img src =“ https://i.sstatic.net/kd6v4.png” alt =“ vs代码对话框屏幕截图”>

单击“刷新凭据”按钮后,链接的页面无法在我的浏览器中解决,显示<< code> err_connection_refused :

​允许我进行身份验证,但对VS代码没有影响。

我可以在Azure Data Studio中使用相同的连接详细信息来成功连接。

Here's an example of a connection configuration that has stopped working (it's for connecting to an Azure managed database):

{
  "server": "sqldb.12345abcde.database.windows.net",
  "database": "sqldb01",
  "authenticationType": "AzureMFA",
  "profileName": "sqldb01",
  "azureAccountToken": "",
  "expiresOn": 1648022420,
  "email": "[email protected]",
  "accountId": "aaaaaaaa-0000-bbbb-1111-cccccc222222"
}

When I try to connect, VS Code displays a dialog saying mssql: Credential Error: Account credentials have expired. Please re-authenticate. and another saying mssql: undefined:

VS Code dialog screenshot

After clicking the refresh credentials button, the linked page fails to resolve in my browser, showing ERR_CONNECTION_REFUSED:

ERR_CONNECTION_REFUSED browser screenshot

When I reinstall the plugin, remove my connection definitions from settings.json and attempt to create a new connection, the browser page resolves correctly and allows me to authenticate, but it has no effect in VS Code.

I'm able use the same connection details in Azure Data Studio to connect successfully.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

安稳善良 2025-02-04 15:07:21

我遇到了相同/相似的问题,在我的情况下发现了2个可能的问题。我进入了Windows凭据管理器,并删除了 aad-iv aad-key 凭证,以及其他所有未经修改的人:今天(大概是过高的工作)。

然后,当我在VSCODE再次尝试时,我收到了一个错误,但能够通过它来进行凭据。就我而言,然后无法与一个选项连接以自动添加防火墙规则……然后一切都起作用。

我不确定它是否不够聪明,无法弄清楚如何刷新凭据或试图使用它,但是带有防火墙规则的某些东西会进入图片并破坏它。

此后,我注意到Windows凭据管理器具有 aad-iv aad-key 凭证。所以...我会尝试删除那2个,看看会发生什么。

I had the same/similar problem and found 2 possible issues in my case. I went into Windows Credential Manager and Removed the aad-iv and aad-key credentials, as well as all the others that did not say Modified: Today (presumably overkill).

When I then tried again in VSCode, I received an error but was able to proceed by it giving me a chance to enter credentials. In my case, it then failed to connect with an option to automatically add a firewall rule... and then everything worked.

I'm not sure if it wasn't smart enough to figure out how to refresh credentials OR if it was trying to but something with the firewall rule came into the picture and disrupted it.

After this, I noticed Windows Credential Manager had aad-iv and aad-key credentials added back. So... I would try removing just those 2 and see what happens.

梦旅人picnic 2025-02-04 15:07:21

我通过删除此文件夹的内容(MAC):〜/library/Application支持/VSCODE-MSSQL/AAD来解决此问题。

我相信Windows上的等效物将像c:\ users \ {userName} \ appdata \ roaming \ roaming \ vscode-mssql \ azure Accounts

I resolved this by deleting the contents of this folder (Mac): ~/Library/Application Support/vscode-mssql/AAD.

I believe the equivalent on Windows would be something like C:\Users\{username}\AppData\Roaming\vscode-mssql\Azure Accounts.

鹿港巷口少年归 2025-02-04 15:07:21

我做的和benmcf一样。但是,我还删除了AAD文件夹:
c:\ users \ {user} \ appdata \ roaming \ vscode-mssql \ aad

之后,我卸载了MSSQL扩展名,然后再次安装。然后它起作用。

I did the same as benmcf. However, I also deleted the AAD folder:
C:\Users\{user}\AppData\Roaming\vscode-mssql\AAD

After it, I uninstalled the MSSQL extension and installed again. Then it worked.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文