Expected OAuth 2 access token, login cookie or other valid authentication credential

399 views
Skip to first unread message

Ranjeet Ranjan

unread,
Jul 1, 2020, 5:50:02 PM7/1/20
to AdWords API and Google Ads API Forum
I Ma getting very unexpected error while getting customers:listAccessibleCustomers


 -H 'Authorization: Bearer {your-access-token-here}' \
 -H 'developer-token: {your-developer-token-here}'


{

  "error": {

    "code": 401,

    "message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",

    "status": "UNAUTHENTICATED"

  }

}


Although I am using the below request for proper access token and refresh token.

<<Option -1>>

https://accounts.google.com/o/oauth2/v2/auth?response_type=code&access_type=offline&client_id=XXXXX&redirect_uri=https://YYY.com/google/callback&state=XXXX&scope=https://www.googleapis.com/auth/adwords&prompt=consent&o2v=2&as=XXXX&flowName=GeneralOAuthFlow

<<Option -2>>

https://accounts.google.com/signin/oauth/oauthchooseaccount?response_type=code&access_type=offline&client_id=XXXXX&redirect_uri=https://YYY.com/google/callback&state=XXXX&scope=https://www.googleapis.com/auth/adwords&prompt=consent&o2v=2&as=XXXX&flowName=GeneralOAuthFlow


Kindly help to solve. 



Reply all
Reply to author
Forward
0 new messages