Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
I put the
grant_type
parameter in the request body as the documentation shows, but Microsoft Graph still complains that it's not there;
const tokenRequestBody = [
"grant_type=client_credentials",
"scope=https%3A%2F%2Fgraph.microsoft.com%2F.default",
`client_secret=${config.appClient.password}`
].join("&");
request.post(
url: tokenRequestUrl,
json: true,
headers: {
"content-type": "application/application/x-www-form-urlencoded"
body: tokenRequestBody
(err, req, body) => {
console.log(body.error_description);
// Logs: The request body must contain the following parameter: 'grant_type'.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.