Closed evercode1 closed 9 years ago
Unable to reproduce. Ensure you have setup your application at Google correctly and put its credentials at config correctly.
I have same problem on shared host The error occurred when google return user back to site ,I think it's about curl.
The problem I experienced was on my end. I had the configuration wrong, even though it was giving me that Exception – yii\authclient\InvalidResponseException message. It had nothing to do with curl.
I was able to connect and authorize Google via yii2authclient, however it is returning the following error:
Exception – yii\authclient\InvalidResponseException
Request failed with code: 401, message: { "error" : "invalid_client" }
Full Gist of error:
https://gist.github.com/evercode1/2116653dfdd765facda2
This seems like bug because I copied the config right out of the guide:
'google' => [ 'class' => 'yii\authclient\clients\GoogleOAuth', 'clientId' => 'my_id', 'clientSecret' => 'my_secret', ],
Obviously I have plugged in the appropriate values for my_id and my_secret. Also, I have successfully setup Facebook, Github and Twitter using Yii2 authclient, so my actions method and onAuthSuccess methods are working properly for those providers.
I did have a problem where Google was encoding my callback url, but I fixed that by switching to pretty url.