not able to get access token while mentioning grant type to authorization_code after getting code from authorize url

Manpreet Singh 56 Reputation points

I did get the code from the authorize url after hitting this url: id -----/oauth2/v2.0/authorize?
client_id=----client id------

but get error of "invalid_grant" while sending post request to this url:


Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,038 questions
0 comments No comments
{count} votes

Accepted answer
  1. Zehui Yao_MSFT 5,846 Reputation points

    Hi @Manpreet Singh , please check whether your code parameter is consistent with the content of the response. From my testing, the problem may live here.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful