node.js - 使用 'Azure AD-Universal with MFA' 连接 Azure SQL 数据库的 NodeJs 代码

标签 node.js azure azure-active-directory azure-sql-database

我一直在尝试找出一些 NodeJS 代码,以便通过 Azure AD 身份验证从我的 NodeJs 应用程序连接到 Azure SQL 数据库。但这只涉及我的电子邮件 ID。我没有任何 Azure AD 应用程序,因为这将来自电子邮件 ID。我通常使用电子邮件 ID 登录 Azure SQL DB,并从 MSSMS 中选择“Azure Active Directory-Universal with MFA”选项。有什么方法可以从 NodeJs 中的代码复制这个

最佳答案

如果你想Use Azure Active Directory authentication对于 Azure SQL 数据库,您必须为其配置 Azure AD。

请引用本教程:Configure and manage Azure AD authentication with Azure SQL

SSMS 和 SqlPackage.exe 是当前通过 Active Directory 通用身份验证启用 MFA 的唯一工具。

对于你的问题“有没有什么方法可以让我们从 NodeJs 中的代码复制这个”,答案是否定的,没有。 Node.js 仅支持以下类型:

身份验证类型

  • 身份验证方法的类型,有效类型为 defaultntlmazure-active-directory-passwordazure-active-directory-access-tokenazure-active-directory-msi-vmazure-active-directory-msi-app-service

引用号:https://tediousjs.github.io/tedious/api-connection.html

HTH。

关于node.js - 使用 'Azure AD-Universal with MFA' 连接 Azure SQL 数据库的 NodeJs 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66203445/

相关文章:

javascript - 从通过解析 XML 生成的 JSON 响应中获取 Key 的值

azure - 在没有flask的情况下在azure中运行python函数

azure - 宇宙数据库 : Find the index of an item in an array

c# - 无法从 Azure AD 获取不记名 token 以与 API 应用程序一起使用

asp.net-mvc-4 - 通过单击 MVC 4 应用程序中的登录按钮重定向到 Azure Active Directory

Azure AD Powershell : Grant consent failed with error: Application is requesting permissions that are either invalid or out of date

node.js - LoopBack 4 - 在 API 资源管理器中添加 'Authorize' 按钮

node.js - Puppeteer - 单击 div 不起作用

azure - 如何使用 Microsoft Graph API 更新 Azure AD 中的现有用户

node.js - Vue项目中npm INSTALL命令的问题