SAP / gigya-android-sdk

SAP CDC (Gigya) android sdk for mobile
Apache License 2.0
19 stars 13 forks source link

[Android][Huawei][Google Sign in] Browser does not open for sign in on version 5.1.2 #26

Closed MarineJ closed 3 years ago

MarineJ commented 3 years ago

Hi,

After updating from gigya-android-sdk-4.0.11 to gigya-android-sdk-core-v5.1.2 our flow stopped opening the web browser to offer google sign in process to our users on Huawei.

Instead I get an exception about google play services unavailability from the provider factory.

W/GooglePlayServicesUtil: requires the Google Play Store, but it is missing. W/Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed) W/System.err: java.lang.RuntimeException: Google auth library implementation is a required dependency. Please make sure it is correctly implemented in your build.gradle file. W/System.err: https://developers.gigya.com/display/GD/Android+SDK+v4#AndroidSDKv4-Google W/System.err: at com.gigya.android.sdk.providers.ProviderFactory.getProviderClass(ProviderFactory.java:89) W/System.err: at com.gigya.android.sdk.providers.ProviderFactory.providerFor(ProviderFactory.java:45) W/System.err: at com.gigya.android.sdk.api.BusinessApiService.login(BusinessApiService.java:233) W/System.err: at com.gigya.android.sdk.Gigya.login(Gigya.java:440)

Our flow uses login functionality from business api

public void login(String socialProvider, Map<String, Object> params, GigyaLoginCallback<T> gigyaLoginCallback) { GigyaLogger.debug("Gigya", "login: with provider = " + socialProvider); this._businessApiService.login(socialProvider, params, gigyaLoginCallback); }

Also I noticed that this comment has been removed from the doc :

Screenshot 2021-08-11 at 17 19 45

Google won't allow sign-in using embedded WebView anymore but opening web browser should still be allowed right ?

Does this change in your code doc means that opening the web browser using the intent to sign in is not available anymore ?

Checked on: Huawei nova 5i - GLK-LX1U Android 10

Thx in advance for your feedback

tal-mi commented 3 years ago

Google do not permit signing in using a web view. Therefore, you will need to implement the Google Auth library in order for the flow to work. Follow: https://developers.google.com/identity/sign-in/android/start-integrating for instructions. An example is available on the repo under example-kotlin app.

No code changes are required.

Tal

MarineJ commented 3 years ago

Hi Tal,

Thx for your feedback. I am not trying to use a WebView but to keep the same behaviour as before on Huawei (let the sdk open a standalone browser to let the user sign in). Also, I already added google auth implementation into my build Gradle.

My problem is that the sdk's ProviderFactory doesn't allow to create the GoogleProvider on my device.

tal-mi commented 3 years ago

Any additional information you can provide? So I can see why the provider is not initialized. Google does not permit a standalone browser login anymore only via their SDK.

MarineJ commented 3 years ago

I didn't know that it is not allowed to use standalone browser. I only found this info on their blog that seems to say we have to enable a user's preferred routing to their chosen default web browser : https://developers.googleblog.com/2021/06/upcoming-security-changes-to-googles-oauth-2.0-authorization-endpoint.html#instructions-android

tal-mi commented 3 years ago

Is Google Play installed on your device or are there any regional restrictions?

MarineJ commented 3 years ago

Hello Tal,

Neither Google play services nor Google Play Store are installed on the device. I am using a Huawei nova 5i - GLK-LX1U Android 10

tal-mi commented 3 years ago

Google sign via the Google Provider requires play services availability. I assume that is the issue cause Huawei can not use Google products or services on their smartphones.

MarineJ commented 3 years ago

Ok thx.

I just go surprised that I can still use the older version of the Gigya SDK to login in through web browser on this same device and it doesn't work anymore with the new version. But maybe it's not possible anymore with new version of google auth library. Do you know if Gigya has any plan to support those devices ? Maybe by implementing HMS https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-auth-android-google-0000001053372648 ?

tal-mi commented 3 years ago

I will investigate further and see if we can provide a quicker solution.

MarineJ commented 3 years ago

Hi Tal,

Thank you for investigating this ! Do you have any update on the topic ?

tal-mi commented 3 years ago

Currently, the only way to override Google's ban is HMS. This issue will likely to get into discussion in the following week and I will be able to provide an answer.

MarineJ commented 3 years ago

Ok thx a lot ! I'll wait to hear from you.

tal-mi commented 3 years ago

The SDK is currently aligned with Google practices for Sign In using Google Play Services. Using Huawei specialized implementations is currently not in the pipeline. You are able to request a feature request via our support link: https://developers.gigya.com/display/GD/Opening+A+Support+Incident

MarineJ commented 3 years ago

Hi Tal,

I will do that. Thx for your feedback. I'll close this issue if it's ok with you after creating my issue on the portal.

Best regards