reactmore / morelab

Starter Admin Panel Codeigniter 4
MIT License
22 stars 12 forks source link

Google Service 401 Exception #17

Open anangkf opened 6 days ago

anangkf commented 6 days ago

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 commented 6 days ago

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     }