admin管理员组文章数量:1417070
I am trying to connect MS Graph Subscriptions to a Google HTTP Cloud Function on Node.js. To establish the trust between the MS Graph subscription and the HTTP Cloud Function a token needs to be exchanged. The token is received by the HTTP function and returned back to MS Graph but a Valdidation Error occurs.
{
"error": {
"code": "ValidationError",
"message": "d2e35dec-a4ba-9142-1129-139539c37a74",
"innerError": {
"date": "2025-02-02T17:07:07",
"request-id": "a975ae23-b3ae-454f-892a-581465fe87ba",
"client-request-id": "d2e35dec-a4ba-9142-1129-139539c37a74"
}
}
}
The response from the HTTP Cloud Function as per below.
functions.http('groupsHttp', (req, res) => {
let validationToken = req.query.validationToken;
let validationTokenArray = validationToken.split(' ');
let finalToken = validationTokenArray.at(-1).toString();
return res.setHeader('Content-Type', 'text/plain; charset=utf-8').status(200).send(finalToken);
});
According to Microsoft these requirements need to be in place. 1.An HTTP 200 Status Code must be returned 2.The Content-Type must be of ‘text/plain’ 3.Return a body containing the Validation Token that was provided by the initial Graph request 4.All this must be done within 10 seconds of the initial Graph request
Any hint or idea what is missing here?
Tried various options of returning the response correctly but it is declined by MS Graph every time even when message and client-id aka token are matching.
I am trying to connect MS Graph Subscriptions to a Google HTTP Cloud Function on Node.js. To establish the trust between the MS Graph subscription and the HTTP Cloud Function a token needs to be exchanged. The token is received by the HTTP function and returned back to MS Graph but a Valdidation Error occurs.
{
"error": {
"code": "ValidationError",
"message": "d2e35dec-a4ba-9142-1129-139539c37a74",
"innerError": {
"date": "2025-02-02T17:07:07",
"request-id": "a975ae23-b3ae-454f-892a-581465fe87ba",
"client-request-id": "d2e35dec-a4ba-9142-1129-139539c37a74"
}
}
}
The response from the HTTP Cloud Function as per below.
functions.http('groupsHttp', (req, res) => {
let validationToken = req.query.validationToken;
let validationTokenArray = validationToken.split(' ');
let finalToken = validationTokenArray.at(-1).toString();
return res.setHeader('Content-Type', 'text/plain; charset=utf-8').status(200).send(finalToken);
});
According to Microsoft these requirements need to be in place. 1.An HTTP 200 Status Code must be returned 2.The Content-Type must be of ‘text/plain’ 3.Return a body containing the Validation Token that was provided by the initial Graph request 4.All this must be done within 10 seconds of the initial Graph request
Any hint or idea what is missing here?
Tried various options of returning the response correctly but it is declined by MS Graph every time even when message and client-id aka token are matching.
Share Improve this question asked Feb 2 at 20:40 Ben SchleefBen Schleef 11 Answer
Reset to default 0Got the issue. You need to return not only the token but the whole string in text/plain to make it work.
functions.http('groupsHttp', (req, res) => {
let validationToken = req.query.validationToken;
return res.set('Content-Type', 'text/plain; charset=utf-8').status(200).send(validationToken);
});
本文标签: MS Graph Subscriptions Webhooks to Node JS Google Cloud FunctionsStack Overflow
版权声明:本文标题:MS Graph Subscriptions Webhooks to Node JS Google Cloud Functions - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745257461a2650187.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论