How to Perform Google Oauth 2.0 Authentication with Monaca

Asked 1 years ago, Updated 1 years ago, 77 views

This is my first time to ask you a question.
 
Monaca produces Google collaboration applications that support iOS and Android.
Until now, I used to do OAuth authentication for Google on the webview, but
Starting April 20, 2017, on platforms where alternatives are actually available,
All OAuth clients using WebView will be blocked by Google
As an alternative, use the cordova-plugin-googleplus plug-in and
I would like to do Google Outh authentication.

Import cordova-plugin-googleplus on Monaca and
You can generate Google-services.json and GoogleService-Info.plist on GoogleDeveloperConsole, and I created the following function and attached it to the button in html, but it doesn't work.
Could you tell me how to use cordova-plugin-googleplus in Monaca?

 function googlePlusTest(){

    console.log("GooglePlusTest Login");      
    window.plugins.googleplus.login(
        {
           'scopes': 'https://www.googleapis.com/auth/tasks',
           'webClientId': 'Retrieved Client ID',
           'offline': true,
        },


        function(obj){
            alert('login succeeded');
            alert(JSON.stringify(obj));
        },

        function(msg){
            alert('error:'+msg);
        }
    );        
}

javascript ios monaca oauth google-api

2022-09-29 21:55

2 Answers

Community has raised the issue, so please give me an answer about the current situation...

The API service using GooglePlus ended on March 7, 2019.
https://developers.google.com/+/api-shutdown?hl=ja

Therefore, the current answer is that implementation is not possible.


2022-09-29 21:55

If it doesn't work, does it mean that an error callback is called?
Or is neither success nor error called?

It says iOS and Android are compatible, but the tag says ios, so please let me check the ios case.


in the Cordova plug-in configuration REVERSED_CLIENT_ID
Have you set the ?

Are you checking the debug build instead of the Monaca debugger?

Also, as a supplement to the Android case, the keystore alias fingerprint is
As it will be necessary, I don't think the current Monaca will be able to use it for debugging builds.
For release builds, the keystore alias fingerprint will be displayed in the keytool command
I think you can check in .


2022-09-29 21:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.