Software Archive
Read-only legacy content

google login

Alberto_G_
初学者
1,800 次查看

Hi everyone,

I'm developing an app that requires login via google. I followed the tutorial on this page (https://software.intel.com/en-us/html5/articles/oauth2-with-intelxdk-cordova-html5#comment-1809957), but  was not able to configure all the parameters correctly. For example I do not understand which value must have parameter Auth_url, or the possible values of scope.

Can you help me?

0 项奖励
4 回复数
Elroy_A_Intel
员工
1,800 次查看

Did you try the example at https://github.com/krisrak/jquery-cordova-oauth2 which the "Using Oauth 2.0 login for HTML5 apps" article is based on?

0 项奖励
Alberto_G_
初学者
1,800 次查看

hi,

thank for your answer.

Yes, i alredy try the example. I donwloaded the zip file and run it in intel xdk, but when i test the application on device i get this error

Screenshot_2015-01-09-08-53-49.png

and this is the code i set 
 

function oauth2_login() {
    $.oauth2({
        auth_url: 'https://accounts.google.com/o/oauth2/auth',           // required
        response_type: 'token',      // required - "code"/"token"
        client_id: '****.apps.googleusercontent.com',          // required
        redirect_uri: 'http://localhost',       // required - some dummy url
        other_params: {scope:'profile'}        // optional params object for scope, state, display...
    }, function(token, response){
        // do something with token or response
        $("#logs").append("<p class='success'><b>access_token: </b>"+token+"</p>");
        $("#logs").append("<p class='success'><b>response: </b>"+JSON.stringify(response)+"</p>");
    }, function(error, response){
        // do something with error object
        $("#logs").append("<p class='error'><b>error: </b>"+JSON.stringify(error)+"</p>");
        $("#logs").append("<p class='error'><b>response: </b>"+JSON.stringify(response)+"</p>");
    }); 
}
       

 

0 项奖励
Abhigyan_G_
初学者
1,800 次查看

Hi,

I need some help regarding google login in cordova intel xdk, I am able to call google login page but after login not going to my project,Its going somewhere else

0 项奖励
PaulF_IntelCorp
1,800 次查看

Please research this issue on StackOverflow under the Cordova link. The XDK creates standard Cordova apps and StackOverflow and the many blogs regarding Cordova apps are your best resource for resolving this question. We do not providing general programming support in this forum, only product-specific support.

0 项奖励
回复