【发布时间】:2022-11-17 23:06:18
【问题描述】:
我正在使用 node-ews 从 Microsoft Exchange 服务器获取电子邮件。 基本身份验证工作正常。
但是,由于 Microsoft 禁用了基本身份验证。 我们目前正在使用来自 Graph Explorer 的 OAuth 令牌(访问令牌)进行测试。
但它返回 401 Unauthorized 错误。
这是我们用来连接到交换服务器的示例代码。
const ewsConfig = {
username: item.mail_username,
password: item.user_pass,
host: item.ews_host,
token: 'xxxxxxxxxxx',
auth: 'bearer'
};
// initialize node-ews
const options = {
rejectUnauthorized: false,
strictSSL: false
};
// initialize node-ews
const ews = new EWS(ewsConfig, options);
【问题讨论】:
标签: node.js exchangewebservices node-ews