I'm using Social Login Extension in Magento 226 trying to login with Google but it's showing below error.
Ooophs, we got an error: User profile request failed! Google returned
an invalid response:stdClass::__set_state(array( 'error' =>
stdClass::__set_state(array( 'code' => 403, 'message' => 'Legacy
People API has not been used in project 36088930720 before or it is
disabled. Enable it by visiting
https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project=36088930720
then retry. If you enabled this API recently, wait a few minutes for
the action to propagate to our systems and retry.', 'status' =>
'PERMISSION_DENIED', 'details' => array ( 0 =>
stdClass::__set_state(array( '@type' =>
'type.googleapis.com/google.rpc.Help', 'links' => array ( 0 =>
stdClass::__set_state(array( 'description' => 'Google developers
console API activation', 'url' =>
'https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project=36088930720',
)), ), )), ), )), ))
Sometimes Error Changes to below error,
Ooophs, we got an error: User profile request failed! Google returned
an invalid response:stdClass::__set_state(array( 'error' =>
stdClass::__set_state(array( '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', )), ))
Things I've tried but didn't work,
- I've tried visiting URL that suggested in Error but it shows
- Creating new Credentials.
- Tried enabling google+, contacts, script
APIs.
Can anyone tell me how to resolve this error?
Best Answer
Finally, I have found an answer by myself after some digging. I did some changes to the Hybrid Library file. Make sure you enable Google People API as Google+ APIs have been Shutdown.
Before changes, the code was as followed,
After the changes, which is working code as followed,
After changing to this code, my google api is working fine.