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 Applications API
Microsoft Graph Applications API
A Microsoft API that enables you to manage these resources and actions related to applications in Azure Active Directory.
497 questions
Microsoft Graph Identity API
Microsoft Graph Identity API
A Microsoft API to access Azure Active Directory (Azure AD) resources to enable scenarios like managing administrator (directory) roles, inviting external users to an organization, and, if you are a Cloud Solution Provider (CSP), managing your customer's data.
272 questions
No comments
{count} votes

Accepted answer
  1. Zehui Yao_MSFT 3,791 Reputation points Microsoft Vendor

    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