A Microsoft API that provides programmatic access to Microsoft Advertising to manage large campaigns or to integrate your marketing with other in-house systems.
Hello Ashmit Mehta,
Thank you for providing the detailed information, including the Trace IDs and Correlation IDs.
Based on the information you shared and the Microsoft Advertising OAuth documentation, a possible reason for this behavior is that the refresh token associated with the affected user was invalidated by Microsoft's authorization service.
Although refresh tokens are generally long-lived, they are not guaranteed to remain valid indefinitely. Microsoft states that refresh tokens can be invalidated at any time, even if they are being refreshed regularly and the application is correctly storing the most recently issued refresh token. This may occur if the user changes their password, removes a trusted device, revokes the application's permissions, or if Microsoft determines that the user must grant consent to the application again.
As a result, the authorization service may return the following error:
invalid_grant - AADSTS70000: The user could not be authenticated as the grant is expired. The user must sign in again.
Based on the details provided, there is no clear indication that your refresh token redemption logic is incorrect. Since the issue appears to be isolated to a specific user account and your implementation follows the recommended OAuth flow by storing the latest refresh token after each successful redemption, it is possible that the user's grant was invalidated due to an account-specific authentication, security, or consent-related event.
Regarding the Trace IDs and Correlation IDs, I am unable to determine the exact reason for the grant rejection from the information provided. However, I can coordinate with our Engineering Team to investigate the specific authentication events associated with the Trace IDs and Correlation IDs you supplied.
Additionally, I will forward your other questions regarding the AADSTS70000 error behavior and refresh token handling recommendations to our Engineering Team for further clarification and guidance.
To proceed with the escalation, please check your private messages, as I will need to collect some additional information from you before I can engage our Engineering Team for further review.
I look forward to your response.
Kind regards,
Chris | Microsoft Advertising Support Specialist | 1-800-518-5689