Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Service 401 Exception #17

Open
anangkf opened this issue Jun 26, 2024 · 1 comment
Open

Google Service 401 Exception #17

anangkf opened this issue Jun 26, 2024 · 1 comment

Comments

@anangkf
Copy link

anangkf commented Jun 26, 2024

hello devs,

i am facing an error while configurating the starter template.
after added the json google api client id for oauth then i try the login feature with the creds given on readme. unfortunately i got the 401 exception. here is the error message:

Google\Service\Exception #401
{
"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": {
"method": "analytics.gaapi.v3.AnalyticsManagementAccounts.List",
"service": "analytics.googleapis.com"
}
}
]
}
}
@anangkf
Copy link
Author

anangkf commented Jun 26, 2024

additionally, the error was caused by VENDORPATH\google\apiclient\src\Http\REST.php at line 128

// retry strategy
123     if (intVal($code) >= 400) {
124       // if we errored out, it should be safe to grab the response body
125       $body = (string) $response->getBody();
126 
127       // Check if we received errors, and add those to the Exception for convenience
128       throw new GoogleServiceException($body, $code, null, self::getResponseErrors($body));
129     }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant