google-api-php-client: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential
Hello all I’m trying to reach google analytics scope in order to get the total visitors to my sit but i get this error when I use the json file of Outh 2.0 in the setConfig method
{
"error": {
"code": 401,
"message": "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.",
"errors": [
{
"message": "Login Required.",
"domain": "global",
"reason": "required",
"location": "Authorization",
"locationType": "header"
}
],
"status": "UNAUTHENTICATED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "CREDENTIALS_MISSING",
"domain": "googleapis.com",
"metadata": {
"service": "analyticsreporting.googleapis.com",
"method": "google.analytics.reporting.v4.Reporting.GetReports"
}
}
]
}
}
Why this happened i need to know
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 15 (5 by maintainers)
I’ll reply with an example tomorrow. If I don’t send me a dm
On Mon, 18 Sep 2023 at 17:22, oolul @.***> wrote: