Hello.js google credential not showing

1k views Asked by At

I am trying to use hello.js plugin to connect with Facebook and google.

my code is as follow

<div id="profile"></div>
<script>
    hello.on('auth.login', function(auth){
        // call user information, for the given network
        hello( auth.network ).api( '/me' ).then( function(r){
            // Inject it into the container
            var label = document.getElementById( "profile_"+ auth.network );
            if(!label){
                label = document.createElement('div');
                label.id = "profile_"+auth.network;
                document.getElementById('profile').appendChild(label);
            }
            label.innerHTML = 'Your Network '+ auth.network +' has <img src="'+ r.thumbnail +'" /> Hey '+r.name+' your ID is '+r.id+' And EMail '+r.email;
        });
    }); 

    hello.init({
        facebook : 'xxxxxx',
        google   : '3xxxxxxsrgut3466k1nunigepmsd3.apps.googleusercontent.com',
        twitter  :  'xxxxxxx'                            
        },{redirect_uri:'http://wstation.xxx.com/'}); 
</script>

SO I am trying to print some details like name, id and email.

In the result I can see Email for facebook, but for google email is not coming.

Can any one tell me if I need to change something in the call for google.

Also Twitter login is not working here. I am confused what credentials to provide for twitter.

Thanks in Advance

2

There are 2 answers

0
Vikram Anand Bhushan On BEST ANSWER

So I got the solution

Its here

Link

Basically we will have to call the plugin like this. With the scope next to redirect URL

hello.init({
        // {provider:key,..}                       
},{
        redirect_uri:'http://wstation.xxx.com/',
        scope:'email'
}); 

Thanks

0
Paulo On

With facebook, adding

hello( auth.network ).api( '/me' scope{
   email: 'email',
     force: true
}).then 

seems to work for the emails and the basic profile, however for google email credential, you will have to edit the hello.min.all.js file

find

scope{basic:"https://www.googleapis.com/auth/plus.me profile", email:'email', ....

and replace with

scope{ basic:"https://www.googleapis.com/auth/plus.me profile,https://www.googleapis.com/auth/userinfo.email", email:'email' ...