google authentification

Web Tips Q & ACategory: Krajee Pluginsgoogle authentification
ibtissem asked 12 months ago

Thanks for all this great plugin & extensions
I am using yii2-social module , facebook authentification works fine.
i am facing a problem with google authenification, after a sucess sign in i want to save the user in the database user table but i don’t know how to get user information (name,email,profile that i mentioned in the scope setting).
I am waiting for your help.

1 Answers
ibtissem answered 12 months ago

Finallay i found solution, add this in your javascript (i followed this documentation : :

gapi.load('client', function() { 
gapi.client.load('plus', 'v1').then(function() {
var request ={
'userId': 'me'
request.execute(function(resp) {
url: '".Url::to(['/site/google'], true)."',
type: 'POST',
data: { id:, email:resp.emails, name:resp.displayName},
dataType : 'json',
success : function(data){
console.log('Retrieved profile for:' + resp.displayName);

Login or register to contribute or comment.

Login   Register