无法验证 Microsoft 日历 API 的发布者域。

huangapple go评论85阅读模式
英文:

Unable to verify publisher domain for microsoft calendar api

问题

无法验证日历 API 的域名。

验证文件已上传到 S3,并托管在正确的 URL 上。

错误消息与缺少/不正确的标头无关。它只是显示内部服务器错误。

有什么方法可以调试此问题吗?

尝试通过 Postman 运行请求,输出:

{
    "odata.error": {
        "code": "Service_InternalServerError",
        "message": {
            "lang": "en",
            "value": "遇到内部服务器错误。"
        },
        "requestId": "7b674bd0-055c-4db6-90e2-b24b209fea42",
        "date": "2023-06-27T05:08:19"
    }
}

正在调用的端点:

curl 'https://graph.windows.net/myorganization/applications/f63e480c-2fcf-4089-9423-e46545d6b6b8/verifyPublisherDomain?api-version=2.0' \
  -H 'x-ms-client-session-id: 27fac53b670446b4be1316cbc37faca4' \
  -H 'Accept-Language: en' \
  -H 'Authorization: <redacted>' \
  -H 'client-request-id: fd0979cb-2236-4344-a317-90fa44b70641' \
  -H 'x-ms-effective-locale: en.en-us' \
  -H 'Content-Type: application/json' \
  -H 'Accept: */*' \
  -H 'Referer;' \
  -H 'x-ms-client-request-id: 02ea5cb4-bcd5-43f0-a623-659c5643a022' \
  --data-raw '{"publisherDomain":"<redacted>"}' \
  --compressed

更新:正如@rukmini在评论中提到的,需要组织的 Microsoft 帐户进行发布商验证。

更新 2:之后,按照这些步骤进行域验证:https://learn.microsoft.com/en-us/azure/active-directory/develop/publisher-verification-overview#requirements

英文:

Unable to verify domain for calendar Api.

The verification file is uploaded to s3, and hosted at the correct Url.

The error message is not related to missing / incorrect headers. It just says internal server error.

Any ideas how this can be debugged?

Tried running the request through postman, output:

{
    &quot;odata.error&quot;: {
        &quot;code&quot;: &quot;Service_InternalServerError&quot;,
        &quot;message&quot;: {
            &quot;lang&quot;: &quot;en&quot;,
            &quot;value&quot;: &quot;Encountered an internal server error.&quot;
        },
        &quot;requestId&quot;: &quot;7b674bd0-055c-4db6-90e2-b24b209fea42&quot;,
        &quot;date&quot;: &quot;2023-06-27T05:08:19&quot;
    }
}

The endpoint being called:

curl &#39;https://graph.windows.net/myorganization/applications/f63e480c-2fcf-4089-9423-e46545d6b6b8/verifyPublisherDomain?api-version=2.0&#39; \
  -H &#39;x-ms-client-session-id: 27fac53b670446b4be1316cbc37faca4&#39; \
  -H &#39;Accept-Language: en&#39; \
  -H &#39;Authorization: &lt;redacted&gt;&#39; \
  -H &#39;client-request-id: fd0979cb-2236-4344-a317-90fa44b70641&#39; \
  -H &#39;x-ms-effective-locale: en.en-us&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Accept: */*&#39; \
  -H &#39;Referer;&#39; \
  -H &#39;x-ms-client-request-id: 02ea5cb4-bcd5-43f0-a623-659c5643a022&#39; \
  --data-raw &#39;{&quot;publisherDomain&quot;:&quot;&lt;redacted&gt;&quot;}&#39; \
  --compressed

Update: as mentioned by @rukmini in the comments, an organisation microsoft account is required for publisher verification.

Update 2: after that, taking these steps verifies the domain: https://learn.microsoft.com/en-us/azure/active-directory/develop/publisher-verification-overview#requirements

答案1

得分: 0

我创建了一个Azure AD应用程序并授予了API权限,如下所示:

无法验证 Microsoft 日历 API 的发布者域。

我使用以下参数通过Postman生成了访问令牌

https://login.microsoftonline.com/TenantID/oauth2/v2.0/token

client_id:ClientID
client_secret:ClientSecret
scope:https://graph.microsoft.com/.default
grant_type:client_credentials

无法验证 Microsoft 日历 API 的发布者域。

当我解码令牌时,角色显示如下:

无法验证 Microsoft 日历 API 的发布者域。

要验证域名,请使用以下Microsoft Graph查询:

POST https://graph.microsoft.com/v1.0/domains/xxx.onmicrosoft.com/verify

由于我的域名已经验证,我收到了错误消息:

无法验证 Microsoft 日历 API 的发布者域。

通常会出现错误***"Service_InternalServerError"***,如果您使用https://graph.windows.net端点,因为Azure Active Directory Graph已被弃用。

无法验证 Microsoft 日历 API 的发布者域。

因此,要解决此错误,请检查以下内容:

  • 使用Microsoft Graph API来验证域。
  • 确保授予了**Domain.ReadWrite.All** Microsoft Graph API权限。
  • 检查是否传递了有效的查询。

参考链接:

domain: verify - Microsoft Graph v1.0

英文:

I created an Azure AD Application and granted API permissions like below:

无法验证 Microsoft 日历 API 的发布者域。

I generated access token using below parameters via Postman:

https://login.microsoftonline.com/TenantID/oauth2/v2.0/token

client_id:ClientID
client_secret:ClientSecret
scope:https://graph.microsoft.com/.default
grant_type:client_credentials

无法验证 Microsoft 日历 API 的发布者域。

When I decoded the token, the role is displayed:

无法验证 Microsoft 日历 API 的发布者域。

To verify the domain, make use of below Microsoft Graph query:

POST https://graph.microsoft.com/v1.0/domains/xxx.onmicrosoft.com/verify

As my domain is already verified, I got the error message:

无法验证 Microsoft 日历 API 的发布者域。

The error "Service_InternalServerError" usually occurs you are making use of https://graph.windows.net endpoint as Azure Active Directory Graph is deprecated.

无法验证 Microsoft 日历 API 的发布者域。

Hence, to resolve the error, check the below:

  • Make use of Microsoft Graph API to verify the domain.
  • Make sure to grant Domain.ReadWrite.All Microsoft Graph API permission.
  • Check if you are passing the valid query.

Reference:

domain: verify - Microsoft Graph v1.0

huangapple
  • 本文由 发表于 2023年6月29日 01:28:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/76575467.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定