为什么可以重新实现(MFA带有MSSQL扩展程序的MFA)?
这是已停止工作的连接配置的示例(它是用于连接到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
:
After clicking the refresh credentials button, the linked page fails to resolve in my browser, showing ERR_CONNECTION_REFUSED
:
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到了相同/相似的问题,在我的情况下发现了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.
我通过删除此文件夹的内容(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
.我做的和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.