[Google Login Plugin] How to Configure the Google Plus Login Plugin for Android

[Google Login Plugin] How to Configure the Google Plus Login Plugin for Android

Forge Component
Published on 2017-07-06 by OutSystems Labs
6 votes
Published on 2017-07-06 by OutSystems Labs

With the Google Plus Login, you can integrate a Google login plugin in your application, easing the login process, and making it unnecessary to create a new account.

Follow the steps below to configure the Google Plus login plugin.

1. Go to the Google API Manager console and log in using your Google credentials.

2. Create a new project.

3. Enter your app's name in the name input.

4. Select and enable the Google + API.

5. Click the Create credentials button.

6. Add credentials to your project.
    a. Select Google+ API in the kind of credentials you need.
    b. Select Web server (e.g. node js, Tomcat) as the setting you'll need to configure.
    c. Choose User data as the data you will be accessing.
    d. Click the What credentials do I need? button.

7. Add authorized redirect URIs.
    a. To authorize all the URLs from the server, add “/*” in Authorized redirect URIs.
    b. To authorize a specific app, add to the URL, the application name and in the end, add “/*” to authorize all application screens.

8. Add the product name that the users will see.

9. Save the Client ID. You will need it during the Android configuration.
Click Done.

The following steps are Android-specific.

1.  Go to Enable Google services for your Android app.

2. Choose the App Name (this should be the same name that you gave to the project), and enter the application identifier (the same as your iOS certificate).

3. Open the command line as Administrator, from the C:\Program Files\Java\<java folder name>\bin directory, and write the following command to generate a release Android certificate (if you want a build for debug mode follow this):

keytool -genkey -v -keystore {my-release-key}.keystore -alias {alias_name} -keyalg RSA -keysize 2048 -validity 10000

a. Replace {my-release-key} with your project name, and {alias_name} with your application name, for example.
b. Save these credentials, to later generate a native build in the Development Environment.
c. You will be asked for a password, your first and last name, your organizational unit, your organizational city, your state and your country. Then you will need to confirm the inserted data and to enter the password you previously defined.
d. The certificate will be created in the following directory: C:\Program Files\Java\<java folder name>\bin.


4. After the certificate is generated, you will need to extract the SHA1 to continue the Google Plus Android configuration. Write the following command line:

keytool -list -v -keystore {keystore_file_path}

a. Replace {keystore_file_path} with the path to the generated certificate.

5. Copy the SHA1 and return to the browser. Paste the SHA1 in the Android Signing Certificate SHA-1 field.

6. Click the Enable Google Sign-in button. The Android configuration is now available in the Dashboard.

7. Go to Service Studio, open the Native Builder for Android and fill in the fields:
    a. App identifier: Same as iOS.
    b. Keystore: Select the generated certificate.
    c. Enter the password that you defined when the certificate was generated.
    d. Enter the alias name defined.
    e. Enter the password again.
    f. Don’t generate the app yet.

8. Open the application module where you want to use Google Login Plugin and add the following JSON to the Extensibility Configuration. This field is mandatory.

9. Add the following Extensibility configuration:
            "url": "https://github.com/EddyVerbruggen/cordova-plugin-googleplus#5.0.3"

10. Return to the browser, copy the Client ID from WebClient1. You will need it later.

11. Reference all actions from the GoogleLoginPlugin. Drag the GoogleLogin action to your client side login action.

12. Define the following parameters, only two are mandatory:

  • IsSilent: Check if the user is already signed in to the app and sign them in silently if they are. You should use the default: False. Change it to True, only if you are sure that the user is already logged in through Google Login.

  • Scopes: The default scopes requested are the profile and the email. To request other scopes, add them as a space-separated list. Refer to the Google Scopes documentation for info on valid scopes that can be requested. Default:

  • ClientId: It's the webClientId value from your Google account/project. It identifies the target account to log in to. This field is mandatory.

  • Offline: Optional, but requires the ClientId. If set to True the plugin will also return a serverAuthCode, which can be used to grant offline access to a non-Google server.

  • ForceApprovalPrompt: Forces the permission popup to appear in each login. Default value: False.

  • IsMapUsers: If True, it means that you want to map the user between the client and the server side. This field is mandatory.

  • OneToOneEmailMapping: Ensures that the given email only matches one user on the server database. Default value: False.

  • CreateGoogleUsers: Ensures that the plugin can create a server user to matches the given email if no user is found.

13. The GoogleLogin action validates the Google account, however, if you want a system login you should code that. Google Core provides you with an action to do that, and it’s explained above.

14. Reference Google Core actions and drag ValidateAndLoginGoogleUser action after the GoogleLogin action.
ValidateAndLoginGoogleUser has the following input parameters: 

  • IdToken: GoogleLogin action returns an IdToken when it’s successful.
  • UserId: GoogleLogin user ID.
  • IsPersistent: If True, the login will be persistent for 15 days.

16. After you call this action, your user is logged in using the OutSystems login, so you can GrantRoles and manage it as you want.

17. The Google Login Plugin is ready. Publish your app.


I followed this guidelines, and also the ones from this page:


But I'm allways getting "Error 10" when calling Login method.

This error code (10), doesn't help much, since it has no description.

From what I investigate, I think this is a configuration / Certificate problem, but no matter what I try, I allways get the same error. (happens on Android - debug or release mode).

Any suggestion / Tip? :)

My best regards 

Hi Gonçalo,

Please make sure that you have a matching package id: "my.appidentifier.id" on Google's console should match the App identifier on Service Studio's Native Platform tab (when your generating the Android build)

Also make sure when generating the Android app you're using the certificate for which the SHA1 fingerprint was extracted and configured on Google's console.

For Android, It's these two settings (App Identifier/Bundle Id and package signing Certificate) that will ensure the application you're running is configured on Google for authentication. IOS uses a different mechanism based on the "iOS URL scheme" or Reverse Client Id, which needs to be set on extensibility configuration.

Kind Regards,

João Grazina

Hello There,

I was attempting to use the plugin to access Google Fit Data on my android platform.I am at a stage where the application grants permission to access the Google Fit Data and is successful in granting the access to the Google Fit Scope for my android app.I can see that on my google user account. After which the Login fails and displays a error.

GoogleLoginPlugin.InvalidUserException: login failed:::Thissssss
    at https://Test-dev.outsystemsenterprise.com/Sandbox_Mobile_Sunil/scripts/GoogleLoginPlugin.controller.js?_KdPDaV5mIcNyGM2n8ka9w:386:7
    at p (https://spotcheck-dev.outsystemsenterprise.com/Sandbox_Mobile_Sunil/scripts/OutSystems.js?wx3+I5+CMvuKnbo8GOLRfg:2:1450)
    at Object.d [as executeSequence] (https://Test-dev.outsystemsenterprise.com/Sandbox_Mobile_Sunil/scripts/OutSystems.js?wx3+I5+CMvuKnbo8GOLRfg:2:1196)
    at https://Test-dev.outsystemsenterprise.com/Sandbox_Mobile_Sunil/scripts/GoogleLoginPlugin.controller.js?_KdPDaV5mIcNyGM2n8ka9w:321:16
    at <anonymous>

I am unable to go beyond this and aquire a valid token to perform the rest of the activities.

Any help would be highly appreciated.



Dear Outsystems Labs,

Please add to this document about the needed REVERSED_CLIENT_ID Variable for IOS.

Reversed Client ID is well, reversed version of client ID.

I almost panic when I cannot generate IPA with Google Plus error, until I read the plugin's Github page.

Here's the extensibility configuration needed for IOS:

            "url": "https://github.com/EddyVerbruggen/cordova-plugin-googleplus#5.0.3",
            "variables": [{
                "name": "REVERSED_CLIENT_ID",
                "value": "com.googleusercontent.apps.478731357925-99lxxxxxxxxxxxxxxxxxx"

Hi All,

For me Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore Barcode.keystore -destkeystore Barcode.keystore -deststoretype pkcs12".

this error is getting in CoomandPromt

Please help me to solve this..

Thank You,


I solved my Previous Issue,

Currently am getting a list of mail id in my mobile, after choosing it, it not logging in to the Main Screen, Its Keep on loading in login Page itself.

Think that due to the last point in this demo

""16. After you call this action, your user is logged in using the OutSystems login, so you can GrantRoles and manage it as you want. ""

Please help me to solve this..

ManiKandan K