我正在运行一个多租户应用程序,并收到了来自“客户”的请求,他声称他从未同意我的服务条款和隐私声明。虽然我声称从一开始就在我的应用程序注册中设置了这两个字段,并且是使用该应用程序所必需的,但我没有找到任何方法来证明这一点,也没有找到任何可以验证“客户”日期的 API 端点同意配置的两个链接。
是否有任何 API(或其他可能性)来获取客户同意我的应用程序注册的日期?
要获取客户同意的日期,您可以运行以下 MS Graph 查询:
GET https://graph.microsoft.com/v1.0/auditLogs/directoryAudits?$filter=activityDisplayName eq 'Consent to application' and result eq 'success' and targetResources/any(c:c/id eq 'spObjID') and initiatedBy/user/id eq 'userId'
我在一个 Azure AD 目录中注册了一个名为
SriMultiApp
的多租户应用程序,并在用户使用以下请求登录时收到了 同意提示:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?response_type=id_token&client_id=<appId>&redirect_uri=https://jwt.ms&scope=User.Read&response_mode=form_post&prompt=consent&nonce=123456778
一旦用户接受上述同意,它将反映在企业应用程序的
Permissions
选项卡中,如下所示:
您可以通过检查应用程序的审核日志找到客户同意应用程序注册的日期:
当我通过使用 Global Administrator 帐户登录在 Graph Explorer 中运行以下查询时,我成功在
activityDateTime
变量中获取了日期:
GET https://graph.microsoft.com/v1.0/auditLogs/directoryAudits?$filter=activityDisplayName eq 'Consent to application' and result eq 'success' and targetResources/any(c:c/id eq 'spObjID') and initiatedBy/user/id eq 'userId'
回复: