I created one sample Mobile application and have Google Login button on Login Screen which on click Starts Google login and In same screen I have Authenticate block which handles On-Success action.
Whenever button clicks there is google Popup for selecting Gmail accounts, After Gmail account is selected there is Error Message "The Login was cancelled". I also attached Error Screenshot. Can't able to identify why this error is coming. I checked Google configuration and it is all correct and it is also working in reactive app.Your help will be appreciated, Thanks in advance.
Same problem here.. I posted a lot of questions but no answer...Please let me know if you find a solution.
Hello!What type of build are you trying to generate?Have you tried generating a "release" build?This may be an issue with Google requiring the SHA1 when working with debug builds.
I can't do a "release build" if we are not sure if the app will ever work.. Because the social logins are needed for more features to come in the mobile app( we are migrating a live production app into this mobile app). I only tried a debug apk.Is there any solution for debug build ?
Also for the apple login. It returns Invalid token in both cases( web and mobile).I created a ruby to encrypt the JWT token using the Elliptic Curve Digital Signature Algorithm (ECDSA) with the P-256 curve and the SHA-256 hash algorithm ( as you know it's required from their part). Is this going to be a problem also for IOS ?
I am sorry for asking too many questions( just to minimize the back and forth exchange).Is there any chance that the decryption gets updated ?
Hi,
I'm also facing this issue. I did create a release apk but it's still returning me the 'the login was cancelled' error. Service Center is not showing any errors in the log. Any updates on how to solve this?
@Bart Nooijens. I solved it Android "release version". It is a bit weird but you need to create two OAuth client IDs on the google console:- One with application type mobile app and import those configs into your "Resources" as json-config( you can specify that by chosing the Deploy Action : Deploy to Target Directory).- The other OAuth client ID is for a web application and you add those via the social login configurator.But still the same problem with apple login. I think it's the same issue which needs two types of configuration.
@Nabil Kriden
Thanks for your reply!
I created a Android OAuth Client Id but this do not return any client secret and in the OutSystems Social Login Configurator it asks me to provide a Client Secret. I did Google a bit and I found that they removed the Client Secret for Android.
How did you configure the Google API console part? Or is it not needed?
Is it possible to provide some step-by-step instructions?
Hello @Bart Nooijens,Yes the client secret is not required in the mobile app( you must choose release app not debug).Since we're going to have two configurations for mobile and web, we need to have both apps also on google console. Therefore:- you create a client id for mobile and configure it of course: set the redirect url to: https://<YOUR_ENV>/SocialLoginConfigurator/rest/SocialLoginAuth/AuthenticateRedirectGoogle. - If you are using Windows, you should generate a realease app and use OpenSSL to sign it. And addthe SHA-1 fingerprint to google console in your client ID for the mobile app.- Create a client ID for Web app also and do the same configurations. Do not forget to add javascript origins url( your env without any app: I mean just until ...getoutsystems.com)If you already generated a mobile app( release) then the next step is unnecessary !! : If can't generate the mobile app then it has to with the json configuration( use this template)
{ "preferences": { "global": [{ "name": "", "value": "" }], "android": [{ "name": "", "value": "" }], "ios": [{ "name": "", "value": "" }] } and choose android version equal to or higher than 24.Of course the json-config can be obtained via the social login configurator and add it as a resource in your target directory.
Hi Nabil,
Thanks for your answer once again!
Could you verify if the steps below are correct?
It is a release app.
1. First step is to create a client id for mobile application. I guess you are meaning I have to choose Android? After that I am not sure what you mean. I know about the redirect urls but I do not have this option when I choose for Android. Am I doing something incorrectly here?
2. I did create a SHA-1 fingerprint for my release app. I guess package name is the app identifier?
3. So basicly now I do have 2 client id's created. One for mobile and one for web.
4. Configuring part in social login configurator. You told me that the client secret is not needed for a mobile app, but it is required to fill in. Did you just fill in something or?
5. Add configuration as resource to the app. Could you show me a example on how your json is looking (removing any sensitive data ofc.)?
Thanks in advance!
Hello,
"app_deeplink": {
"url_scheme": "app85",
"url_host": "sociallogins",
"url_path": "/oauthcallback"
},
"app_configurations": [
{
"provider_id": "3",
"client_id": "<MyMobileClientId>",
"client_secret": "<MyWebSecret>",
"application_type_id": "1",
"client_token": "",
"url_scheme": "",
"redirect_uri": "/SocialLoginConfigurator/rest/SocialLoginAuth/AuthenticateRedirectGoogle"
}, // Do not put the comma here, it's just to add configs for you apple provider if you have one.
]
}
hmm, I am not sure what I am doing wrong. It is still not working.
Well it seems to be working with a work mail address. Not with a personal one. This is good. But I would expect a nice error message and not "The Login was cancelled".
Also, it is weird that you need to provide 2 configurations. Nothing is mentioned in the documentation about that.
Thanks for your help!
I don't know how to help you if you don't know what's wrong.. xD We'll have a call when I can if needed.
Well, your solution with 2 configurations seems to work. Using the mobile client id en the web secret. This is not mentioned in the documentation but it is working :-)
Hi guys, if this works please mark it as solution so that other people in Outsystems community can use it, because it is a frequent use case.
Regards
We are not able to set a solution in this post. This should be done by the original poster :-)
Best,
Bart
OK, thanks for replying @Bart I think @Saifuddin will. ^^