Google Ads API: Request is missing authentication credential
I'm using oAuth2.0 flow to work with Google Ads API. I ran in a problem today that when doing an API Request I'm getting the following 401 error:
UNAUTHENTICATED: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
On the headers of each google ads request I add
{"Content-Type", "application/json"}, {"Accept", "application/json"}, {"User-Agent", "Mozilla/5.0 (Macintosh; ..."}, {"Authorization", "Bearer $ACCESS_TOKEN"}, {"developer-token", "$DEVELOPER_TOKEN"}, {"login-customer-id", "$LOGIN_CUSTOMER_ID"}
I've already tried to generate a new access_token, since my automatically process of generating new access_tokens when the current one expired could be failing, but it wasn't the case. I managed to create a new valid access token and it continues to give the same error. The scope used when fist granted permissions to the app was "https://www.googleapis.com/auth/adwords"
.
Did anyone fall into the same problem?