invalid_grant

Karan Sawhney 1 Reputation point
2021-08-12T07:58:28.073+00:00

I am able to generate the auth and refresh token for my app. But when I use the refresh token to regenerate the auth token it gives me the below error. Note that this used to work until last week for almost 2 years.

{
"error": "invalid_grant",
"error_description": "AADSTS70000: The user could not be authenticated as the grant is expired. The user must sign in again.\r\nTrace ID: dfe52903-9975-4945-a9bf-f07b390ff101\r\nCorrelation ID: b90a7d1c-25de-4bda-b739-dd5911524a69\r\nTimestamp: 2021-08-12 07:26:15Z",
"error_codes": [
70000
],
"timestamp": "2021-08-12 07:26:15Z",
"trace_id": "dfe52903-9975-4945-a9bf-f07b390ff101",
"correlation_id": "b90a7d1c-25de-4bda-b739-dd5911524a69",
"error_uri": "https://login.microsoftonline.com/error?code=70000"
}

@Eric Urban - MSFT

Microsoft Advertising API
Microsoft Advertising API
A Microsoft API that provides programmatic access to Microsoft Advertising to manage large campaigns or to integrate your marketing with other in-house systems.
383 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,455 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Siva-kumar-selvaraj 15,546 Reputation points
    2021-08-13T12:33:12.357+00:00

    Hello @Karan Sawhney ,

    Thanks for reaching out.

    I think you are trying to get access token for Bing Ads API, please correct me if that's not a case in above sceanrio also could you please confirm account type which is being used? ( work/school OR MSA account? )

    I was able to regenerate the auth token by using refresh_token as per this link without any issue so I would recommend you to try this PowerShell way, if that works for you then I guess this issue more on module that you are using to get access token.

    I had seen this similar issue when you try getting auth token through Python modules and issue got resolved by updating BingAds Python module update.

    Please let me know how that goes. Thanks

    ------
    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.
    0 comments No comments