Getting AADSTS65001 error when using API
We are attempting to access the Microsoft Ads API using a refresh token obtained through the OAuth 2.0 authorization code flow. We have:
- Registered the application in Azure AD.
- Logged in using a work account with access to Microsoft Ads.
- Navigated to the
authorize
endpoint withprompt=consent
and successfully received an authorization code. - Exchanged the authorization code for an access token and refresh token (successfully).
- When attempting to use the refresh token in our Java app, we consistently receive the following error:
Couldn't request OAuth AccessTokens. Please use the getDetails() method to get more information. Details: invalid_grant - AADSTS65001: The user or administrator has not consented to use the application with ID '4aafbd96-d0bf-4f04-95f6-641e11b76cd7' named 'Visit App'. Send an interactive authorization request for this user and resource. Trace ID: a08bb0a5-f547-42f3-8a10-711bad4e1c00 Correlation ID: 45088ad3-28be-4d6e-9d21-32e1267dba7a Timestamp: 2025-04-08 18:05:34Z