mkloubert / nativescript-social-login

NativeScript plugin for social (token based) log-ins.
MIT License
42 stars 44 forks source link

Issue getting the Google authToken #26

Closed pedromareis closed 6 years ago

pedromareis commented 6 years ago

Hello guys, I had an issue with the latest version of the plugin (3.0.2) which didn't allow me to get an authToken using the Google Login. Basically my init data (configurations) for google was being overrided by the default configurations instead of merged. I've solved it using an older version of the plugin (1.8.1) and using this:

    SocialLogin.init({
        activity: void 0,
        google: {
            initialize: true,
            isRequestAuthCode: false,
            serverClientId: "<MY-SERVER-CLIENT-ID>.apps.googleusercontent.com",
            shouldFetchBasicProfile: true,
            scopes: ["profile", "email"]
        }
    });

Hope you guys could fix it in the next versions of the plugin, thanks in advance.

jogboms commented 6 years ago

@pedromareis thanks for reporting this. By default, if isRequestAuthCode is not passed in the config, it is set to false. Can you confirm that you added it as a parameter to the config object?

pedromareis commented 6 years ago

@jogboms Yes, I've tried that and got the same error. I've also tried to add more parameters like test: "this is a test" and while debugging, when the plugin merged my configurations with the default ones, all the data I've added was gone.

jogboms commented 6 years ago

If i may, Could you try running your configurations against the demo app?

pedromareis commented 6 years ago

Yeap, same issue...

screenshot_1511533533 screenshot_1511533537

pedromareis commented 6 years ago

And using an older version of the plugin (the 1.8.1) it works! 😛 screenshot_1511533793

jogboms commented 6 years ago

Thanks @pedromareis. I'm on it now.

jogboms commented 6 years ago

@pedromareis could you confirm if installing @next solves this issue?

pedromareis commented 6 years ago

@jogboms It's working, thank you! 😄

jogboms commented 6 years ago

Awesome! Thanks. 👍

johnRosalin commented 6 years ago

I am getting a similar error. The authToken is null however, the authCode has data in it. This is the response that I am getting:

{ "provider":"google", "code":0, "id":"xxxxxxxxxxxxxxxxxxxxx", "photo":{}, "authToken":null, "authCode":"4/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-aPPFRSBwKMq2rftduwwghfeeKoqzIvAI-IfcRd6NJY", "userToken":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "displayName":"xxxxxxxxxxxx", "firstName":"xxxx", "lastName":"xxxxxxx" }

I already did the instructions above, also tried reverting to version 1.8.1 and @next but still got a null authToken. Could this be an error on my google app configuration? or am I missing something?

jogboms commented 6 years ago

@johnRosalin could you try your current configuration with the demo app, and see what happens? Did this work in other versions prior to the latest?

mbd-fondative commented 5 years ago

@pedromareis could you confirm if installing @next solves this issue?

how to install @next and why ?? thank you ..

mbd-fondative commented 5 years ago

@jogboms It's working, thank you!

how to install @next please thank you...

jogboms commented 5 years ago

@Marwen238 Soory for the delay, @next is the latest version, no need installing @next. Use the latest version.