【发布时间】:2022-12-14 10:24:42
【问题描述】:
我正在尝试使用 Microsoft365R 的 get_business_outlook 功能通过我的 business outlook 帐户访问我具有读/写权限的共享邮箱。
library(Microsoft365R)
tenant_id <- "example_tenant_id"
email <- "example@example.co.uk"
outl <- get_business_outlook(tenant_id, shared_mbox_email = email)
我第一次尝试此操作时,收到消息:
使用 authorization_code 流程
为租户“example_tenant_id”创建 Microsoft Graph 登录
使用 authorization_code 流程
正在等待浏览器中的身份验证...
按 Esc/Ctrl + C 中止
身份验证完成。
process_response(res, match.arg(http_status_handler), simplify) 错误:
禁止 (HTTP 403)。无法完成操作。信息:
权限不足,无法完成操作。在随后的运行中,我得到:
process_response(res, match.arg(http_status_handler), simplify) 错误:
禁止 (HTTP 403)。无法完成操作。信息:
权限不足,无法完成操作。我已经看到 this answer 提出了类似的问题,但是使用
app参数没有帮助:app_id <- "example_app_id" outl <- get_business_outlook(tenant_id, shared_mbox_email = email, app = app_id)正在加载租户“example_tenant_id”的 Microsoft Graph 登录
process_response(res, match.arg(http_status_handler), simplify) 错误:
禁止 (HTTP 403)。无法完成操作。信息:
权限不足,无法完成操作。我尝试创建一个令牌,有和没有
resource参数:library(AzureAuth) # Without resource tok <- get_azure_token("", tenant=tenant_id, app=app_id)使用 authorization_code 流程
加载缓存令牌outl <- get_business_outlook(tenant_id, shared_mbox_email = email, app = app_id, token = tok)错误:找不到图形主机 URL
# With resource resource <- "https://graph.microsoft.com/Mail.ReadWrite.Shared" # Get azure token for app tok <- get_azure_token(resource, tenant=tenant_id, app=app_id)这将打开一个浏览器窗口,提示我使用 SSO 登录并显示“未找到”文本。
就像链接问题的海报一样,我是 Graph API 的新手,并且使用了很多 Azure 术语,所以我可能遗漏了一些明显的东西。任何帮助表示赞赏。
【问题讨论】:
标签: r microsoft-graph-api azure-authentication microsoft365 microsoft365r