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:"{ "plugin": { "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:
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:
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.
Hi,
I followed this guidelines, and also the ones from this page:
https://www.outsystems.com/forums/discussion/26075/using-google-login-plugin/
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.
Regards,
Sunil
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:
{ "plugin": { "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,
Manikandan K wrote:
Hi Manikandan K,
I'm having a similar problem as you in the Command prompt. I'm quite new at outsystems world. I'm doing a mobile app in which I would like to login my users with their google account. I have been following this guide, but when I reached the command line these are the following problems I face:
1. I cannot find the file they mention (jre1.8.0_121) in my Java file, but I do find a jre1.8.0_181 and jdk1.8.0_181 . So I followed the logic, and chose the first one.
2. Despite my tries with possible syntax erros, I always get the same message:
"
Set-Location : A positional parameter cannot be found that accepts argument 'Files\Java\jre1.8.0_181\bin>keytool'.At line:1 char:1+ cd C:\Program Files\Java\jre1.8.0_181\bin>keytool -genkey -v -keystor ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Set-Location], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
How did you solve your problem? Could you give me a hand on this as well?
Thank you,
Ana
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. ""
ManiKandan K
ManiKandan Kaliamoorthy wrote:
Have you done step 7?
7. Add authorized redirect URIs. a. To authorize all the URLs from the server, add “/*” in Authorized redirect URIs.
Harlin Setiadarma wrote:
Hi Harlin,I've been trying to follow exactly like the steps mentioned above and as well as from this document https://www.outsystems.com/forums/discussion/26075/using-google-login-plugin/ I would like to ask a few question and I hope you can help me:
1. Do I need to create a "Google Login' button or google will make one for me?
2. For step number 11, " Drag the GoogleLogin action to your client side login action." Hence, I've created a my own google button and the Button action is as shown in the diagram below and this is what I've implemented and I think there're error(s) because when I published the apps for testing on web browser, that button seems not to be working as in, once I click the button, there's no output (remain unchange)
3. Do you have any reference on how you successfully used the Google Login?
4. Do you have any tips that you think I should be wiser on implementing the Google Login Plugin?
Thank you for your time.
Hi, I've experienced the same problem, once I click on my google account, it remains on the login page. If it's not burdening, how to do you manage to fix this? The picture below is my Authorized redirect URIs
Thank you
Anyone successfully used and implemented the technique?
Sharizad Mohamad wrote:
I did. What do you want to ask? I will gladly help.
Hai Harlin,
I am using the cordova-plugin-googleplus plugin
I am unable to generate a mobile app,its throwing the below error.
The following errors have occurred:• In iOS on 2018-09-20 at 15:27:43 - Error installing Cordova plugin: cordova-plugin-googleplus
I have added the extensibility configuration
I got a below the error
Can you please help me, how to solve this..
Thanks
Have you follow above step for creating google login client id?
Hi Harlin Setiadarma,
yes, i done step 7 to add authorized URLs.
Successfully completed my task, Thank you for your responds,
Manikandan K
Hi Sharizad Mohamad,
Think your going in a right way only,
As, You Mentioned in 2, step...
""""2. For step number 11, " Drag the GoogleLogin action to your client side login action." Hence, I've created a my own google button and the Button action is as shown in the diagram below and this is what I've implemented and I think there're error(s) because when I published the apps for testing on web browser, that button seems not to be working as in, once I click the button, there's no output (remain unchange) ""
let me know need more clarification..
1. You need to create the button
2. You can't test it on browser, you need to generate apk or ipa and test it directly on android/ios device.
3. I follow the steps carefully and I did it without any help.
Only things I stumbled was when generating ipa file for ios, it needs special configuration (read my post above about Variable needed on Extensibility Configuration)
If Possible Can you share your Oml so that i can see wat issue you are facing,
else, try to debug using device and have a look on the issue, Ping me back.
Point 13 said that Google Login only validates Authentication in Google Account, you still haven't authenticated to Outsystems, that's why you can't enter Homescreen (which need Registered role), and it will redirect to login screen again.
Point 14 tells how to authenticate this Google UserId returned by Google Login via Outsystems User Provider, after that your session will get Registered role, and your Homescreen will be accessible.
Point 16 tells you, after completing point 14, now your Google User is logged in inside Outsystems, so you can grant role if you needed, but this is completely optional.
This will be a long post, so I'm splitting up.
Google Login client action can be set to map Google Users to your Outsystems User Provider.
In my use case above, I don't really need to login to my app using Google Users, I just need to get some basic info (email, etc).
So I set IsMapUsers property and CreateGoogleUser to False.
If you need to login to Outsystems using Google Users, then you need:
isMapUsers = True
After successful Google Login, this will search for Outsystems User with the same email as the Google User, then map it in component's internal entity.
OneToOneEmailMapping =True/False
You may have more than 1 Outsystems users with the same email.
I don't really understand this property, maybe if you have more than 1 Outsystems user with the same email, it will throw error or something.
CreateGoogleUser = True
If Google Login can't find Google User's email in Outsystems, this property will allow Google Login to create Outsystems User automatically using same name and email as the Google User.
Remember, all this was just to map (or create) Outsystems User from Google User.
But this does not do Login.
To actually login to Outsystems, and get the Registered role so you can access your Homescreen, you need to do point 14 and point 16 together.
Use ValidateAndLoginGoogleUser to actually login to Outsystems using the user map we're doing previously.
Hi Harlin,
I have configured the Google Login Plugin for my app. I have three environments through which the app will be published one after another – Dev, Test and Production.
For each environment I have configured the web, android and ios client ids using the respective bundle identifier and SHA-1 file.
Now we have a principle not to publish directly in the test environment. So I changed the dev’s configuration with the config needed for test environment and we pushed the code. The google login is working fine in Test and also in Dev.
Here are my questions:
I really not an expert on this, I just did this.
Maybe other with expertise can help.
Meanwhile I have managed to solve my problem. For the newcomers in OS, who never had programming in their lifes: after writing the command line C:\Program Files\Java\<java folder name>\bin , just click enter and your problem will be solved. It might be obvious and intuitive for some, but not for others. And those are the ones I'm speaking to :)
hi Ana Calinhos :
Is your issue solved now??
regards,
Yes it is Manikandan, thank you.
Kind regards,
Hi, im trying to make a log in with Google authentication.
I followed step by step and i found 2 prolems.
1) In step 7, authorization URIs I cannot use the "*" symbol (Photo 1)
2) When im using the Client Action GoogleLogin it drops a Error code 2: "Google Login is not defined" in a debugging session (Photo 2 & 3).
If anyone can help me to fix this.
Regards.
Have you generate native apk/ipa?
It won't work in emulator or outsystems now.
Yes, the apk is already genereted.
I think it's because of the error in step 7, but im not sure.
Isn't it affected by this ?
The Google+ Sign-in feature is deprecated and we are shutting down all legacy Google+ APIs on March 7. We recommend that developers migrate to Google Sign-in. Please see our migration tips for Sign-in.
For cases where developers are unable to move over before March 7th, we have created a new implementation of some Google+ APIs critical to sign-in only. The new implementation will only return basic fields necessary for sign-in functionality such as name and email address, if authorized by the user.
https://developers.google.com/+/web/signin/
Hi, i have a message "12500" but i have no clue on this could you please help?
Murilo Antonio.
Hello,
I have the error 10, any clue?
I have follow this topic, registe the app, on firebase, configure the google developers, have Sha-1...
I have no Idea how to solve this error 10.
Best Regards,
PVN
Hi Pedro,
Did you know that Google+ (and its API) shutted down on March 7? And so this plugin won't work longer
Hello everyone.
I've sent a support ticket to outsystems and it seems that this plugin is still working.
So I've tried this plugin and it is working fine on adroid. but I'm getting error message generating ios app. here's the error"In iOS on 2019-12-06 at 10:06:15 - Error installing Cordova plugin: cordova-plugin-googleplus': Error: Cannot find module 'q."
Anyone who experience this error? I already put my extensibility config like this one.
{ "plugin": { "url": "https://github.com/EddyVerbruggen/cordova-plugin-googleplus.git", "variables": [{ "name": "REVERSED_CLIENT_ID", "value": "com.googleusercontent.apps.105xxxxxx-xxxxxxx" }] }}
kindly see attached file for the for the log file
Kim Harold Aguas wrote:
Hello Kim!I'm with the same problem as you...Did you solve it?
Pedro Santos wrote: Yes It's working on android and ios now.
you need to add version on the url. Here's the config I use
{ "plugin": { "url": "https://github.com/EddyVerbruggen/cordova-plugin-googleplus.git#7.0.2", "variables": [{ "name": "REVERSED_CLIENT_ID", "value": "com.googleusercontent.apps.105xxxxxx-xxxxxxx" }] }}
Hello Everyone
I tried to take an android build but its getting failed in MABS version 5.0 with below error. Have anyone faced this issue.
[2019-12-08T11:21:23.206Z] [ERROR] Build failed with the following error: Error generating application. At least one Cordova plugin used in the build requires an AndroidX library, which is not currently compatible with MABS. Check your plugins configuration.
Thanks & Regards
Pradeep.K.K
I have implemented this but it is not redirecting me back in application. Can you help me and tell me what I am doing wrong?
Hemlata khajanchi wrote:
Did you already fixed this one?if not yet, hope this helps :)
In your condition, if the login is successful you can redirect it to your homepage.
else if unsuccessful login, redirect it back to the GoogleLogin function not in the current screen
I haven't used this plugin for almost a year...
Google Plus is being discontinued.
You should use the new api.
https://developers.google.com/+/api-shutdown
https://developers.google.com/+/mobile/android/api-deprecation
https://developers.google.com/identity/sign-in/android/quick-migration-guide
Be advise, it will only work until 7.0.2 the google plus update, after that it will stop working even if you manage to fix the issue regarding the q dependencie which is a easy fix, but after that it will still not work, soo best bet is just use the 7.0.2.
Hi
In iOS the google authentication is happening in inapp browser after login successful it is redirection to google.com inside the browser itself. Have any one faced this issue? Its happening only now after MABS 6.0 Update.
Pradeep KK wrote:
Its an error on your logic most likely, after the successful login you just need to redirect to next page in theory. I have the mabs 6.0 and its working just fine.
Labs wrote:
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.
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.
9. Add the following Extensibility configuration:"{"plugin":{"url": "https://github.com/EddyVerbruggen/cordova-plugin-googleplus#5.0.3"}}"
Hello Team,
I'm following the above given steps and right now I stuck on Step 5- Create Credentials.
When I'm clicking on Create Credentials, it is showing me 4 options, please have a look on below picture -
Most appropriately, If I'm selecting last one i.e., Help me choose, then it is not showing me Google+ Api, it is only showing Other Api when I click on Choose... under Find out what kind of credentials you need, please have a look on below picture -
Even, I have already enabled the Google+ Api, please have a look on below picture -
Could anyone please help me where I'm lacking and how to get this thing done.
I'll be grateful to you.
Will wait for your kind revert.
Rohit