# Bug Report / Bug 报告
**Version / 版本:**
Official Docker image: `ghcr.io/zeropointsix/outlook-email-plus:latest`
**Current behavior / 当前行为:**
OAuth Token 工具中使用 “Graph 邮件” 预设生成授权链接时,scope 为:
```text
offline_access https://graph.microsoft.com/.default
在个人 Microsoft 账号 tenant=consumers 场景下,即使 Azure App Registration 已配置 Microsoft Graph 委托权限 Mail.Read、User.Read、offline_access,并强制 Consent,授权码换取 Token 时仍会报错:
invalid_request: AADSTS90023: No applicable permissions were found for this user.
Expected behavior / 期望行为:
Graph 邮件预设应能在个人 Microsoft 账号场景下正常完成授权并换取 refresh token。
建议 Graph 预设使用具名委托权限:
offline_access https://graph.microsoft.com/Mail.Read https://graph.microsoft.com/User.Read
Steps to reproduce / 复现步骤:
- 使用官方 Docker 镜像部署项目。
- Azure App Registration 配置:
- Supported account types: organizational directory + personal Microsoft accounts
- Redirect URI:
http://localhost
- Public client flow enabled
- Microsoft Graph delegated permissions:
Mail.Read, User.Read, offline_access
- 打开 OAuth Token 工具,选择 “Graph 邮件” 预设。
- 勾选强制 Consent,生成授权链接。
- 使用个人 Microsoft 账号授权,复制回调 URL。
- 粘贴回调 URL 换取 Token。
- 出现
AADSTS90023 错误。
Related code / 相关代码:
// static/js/features/token_tool.js
const SCOPE_PRESETS = {
graph: ['offline_access', 'https://graph.microsoft.com/.default'],
imap: ['offline_access', 'https://outlook.office.com/IMAP.AccessAsUser.All'],
};
# outlook_web/services/graph.py
DEFAULT_GRAPH_SCOPE = "https://graph.microsoft.com/.default"
Other information / 其他信息:
临时验证后,将 Graph scope 改为具名权限可解决该问题:
offline_access https://graph.microsoft.com/Mail.Read https://graph.microsoft.com/User.Read
建议:
- 将前端 Graph 邮件预设从
.default 改为具名 delegated scopes。
- 将 Graph refresh token 默认 scope 同步改为具名 delegated scopes。
- 对历史保存的
offline_access https://graph.microsoft.com/.default 做兼容迁移。
在个人 Microsoft 账号
tenant=consumers场景下,即使 Azure App Registration 已配置 Microsoft Graph 委托权限Mail.Read、User.Read、offline_access,并强制 Consent,授权码换取 Token 时仍会报错:Expected behavior / 期望行为:
Graph 邮件预设应能在个人 Microsoft 账号场景下正常完成授权并换取 refresh token。
建议 Graph 预设使用具名委托权限:
Steps to reproduce / 复现步骤:
http://localhostMail.Read,User.Read,offline_accessAADSTS90023错误。Related code / 相关代码:
Other information / 其他信息:
临时验证后,将 Graph scope 改为具名权限可解决该问题:
建议:
.default改为具名 delegated scopes。offline_access https://graph.microsoft.com/.default做兼容迁移。