我使用节点新闻从Microsoft服务器获取电子邮件。它在基本生活中运作得很好。
但是,由于微软禁用了basic auth。我们目前正在使用图形资源管理器中的OAuth令牌(访问令牌)进行测试。
但它正在返回401个未经授权的错误。
这是我们用来连接到exchange服务器的示例代码。
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);发布于 2022-10-05 21:00:36
. We are currently using the OAuth token (access token) from Graph Explorer to test.图资源管理器令牌只对EWS没有权限,如果使用客户端凭据流,则在EWS中唯一有效的两个权限是EWS.AccessAsUser.All或full_access_as_app。https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-authenticate-an-ews-application-by-using-oauth Mail.Read etc权限在EWS中不起作用,因为它不支持图形支持的更严格的身份验证方案(这是在EWS上使用图形的一个原因)
如果您希望访问EWSEditor,使用EWSEditor https://github.com/dseph/EwsEditor/releases进行测试并获取其令牌。
发布于 2022-11-17 15:06:18
Part 0 --请找到我们用来解决相同问题的解决方案。
该解决方案由三部分组成:
对不起,3条帖子,但作为一个新用户,我有一个限制,不可能为新用户创建超过8个链接等.)
发布于 2022-11-17 15:40:50
https://stackoverflow.com/questions/73964533
复制相似问题