繁体   English   中英

Azure AD 验证与 python

[英]Azure AD validation with python

我在理解 Graph API 文档时遇到了一些困难。 如果用户当前已登录,我想检查内部应用程序。

该应用程序具有以下权限: - 应用程序:读取目录数据 - 委托:读取目录数据 - 委托:读取所有组 - 委托:登录并读取用户配置文件

令牌是在https://login.microsoftonline.com/ {directoryId}/oauth2/token 获得的,情况如下:

理论

文档说 GET /auditLogs/signIns/{id} ( https://docs.microsoft.com/en-us/graph/api/signin-get )

并举例说明: https://graph.microsoft.com/v1.0/auditLogs/signIns/ {id} ( https://docs.microsoft.com/en-us/graph/api/signin-get?view =graph-rest-1.0&viewFallbackFrom=graph-rest-1.6#tabpanel_CeZOj-G++Q_http )

但是我们正在使用的工作 API 请求看起来像https://graph.windows.net/ {directoryId}/...

问题

当我请求https://graph.windows.net/ {directoryId}/auditLogs/signIns/{objectIdOfUser} 时,我得到 [Request_ResourceNotFound]“未找到段 'auditLogs' 的资源。”

当我请求(如文档所示) https://graph.windows.net/auditLogs/signIns/ {objectIdOfUser} 我得到 [Request_BadRequest]“请求 url 中的无效域名”。

当我请求(如文档示例所示) https://graph.microsoft.com/v1.0/auditLogs/signIns/ {id} 我得到 [InvalidAuthenticationToken] “访问令牌验证失败。无效的受众。”

您能否为我们提供一个工作示例(带有纯 URL),说明如何为给定用户获取“objectId”的“signinStatus”资源?

听起来您已经获得了 Azure AD Graph API 的令牌,这与 Microsoft Graph API 不同。

确保使用资源https://graph.microsoft.com请求令牌。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM