![](/img/trans.png)
[英]dynamodb node js --- UnrecognizedClientException: The security token included in the request is invalid
[英]Security token could not be authenticated or authorized error ( Node JS connectivity with MS SQL Server using Tedious)
我正在嘗試通過 ActiveDirectoryPassword 身份驗證機制連接到 SQL 服務器,為此我使用了“乏味”。
但是,每當我運行我的項目時,我都會遇到:
無法驗證或授權安全令牌
下面是我參考了PAGE ON STACKOVERFLOW和微軟官方頁面指南后得出的代碼示例。
var Connection = require('tedious').Connection;
const config = {
server: 'server-name.database.windows.net',
options: {
database: 'database-name',
encrypt: true,
port: 1433
},
authentication: {
type: "azure-active-directory-password",
options: {
userName: "myusername",
password: "mypassword",
}
}
}
var connection = new Connection(config);
connection.on("connect", err => {
if (err) {
console.error(err.message);
} else {
console.log("Connected");
}
});
connection.connect();
此錯誤的可能原因是什么? 謝謝。
安裝繁瑣的版本 12.3.0 解決了我的問題。 代碼是正確的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.