英文:
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:
{
"odata.error": {
"code": "Service_InternalServerError",
"message": {
"lang": "en",
"value": "Encountered an internal server error."
},
"requestId": "7b674bd0-055c-4db6-90e2-b24b209fea42",
"date": "2023-06-27T05:08:19"
}
}
The endpoint being called:
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
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权限,如下所示:
我使用以下参数通过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 Graph查询:
POST https://graph.microsoft.com/v1.0/domains/xxx.onmicrosoft.com/verify
由于我的域名已经验证,我收到了错误消息:
通常会出现错误***"Service_InternalServerError"***,如果您使用https://graph.windows.net
端点,因为Azure Active Directory Graph已被弃用。
因此,要解决此错误,请检查以下内容:
- 使用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:
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
When I decoded the token, the role is displayed:
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:
The error "Service_InternalServerError" usually occurs you are making use of https://graph.windows.net
endpoint as Azure Active Directory Graph is deprecated.
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:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论