Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login with google issues on iOS native app #30

Closed
andyboyd opened this issue May 31, 2021 · 12 comments
Closed

Login with google issues on iOS native app #30

andyboyd opened this issue May 31, 2021 · 12 comments

Comments

@andyboyd
Copy link
Contributor

I'm using identity in a WKWebView on a native iOS app running on iOS 14.5.

When using login with google, the behaviour seems a little strange. I've been able to sign in ok, but when trying to use the Login with google button again to log in to a separate google account, it just hits an infinite spinner and never progresses. The only way to resolve the issue is to uninstall and reinstall the app (which clears any storage associated with the browser inside the sandbox, so it's a clean slate). I've attached a screen recording to demonstrate the issue.

Screen.Recording.2021-05-31.at.14.58.00.mov

The recording was taken using a simulator, but things get even worse on a real device. On device, I just get the following error message from Google:

IMG_C96B059A7B33-1

Additionally, the App Store review guidelines state:

4.8 Sign in with Apple
Apps that use a third-party or social login service (such as Facebook Login, Google Sign-In, Sign in with Twitter, Sign In with LinkedIn, Login with Amazon, or WeChat Login) to set up or authenticate the user’s primary account with the app must also offer Sign in with Apple as an equivalent option. A user’s primary account is the account they establish with your app for the purposes of identifying themselves, signing in, and accessing your features and associated services.
Sign in with Apple is not required if:
Your app exclusively uses your company’s own account setup and sign-in systems.
Your app is an education, enterprise, or business app that requires the user to sign in with an existing education or enterprise account.
Your app uses a government or industry-backed citizen identification system or electronic ID to authenticate users.
Your app is a client for a specific third-party service and users are required to sign in to their mail, social media, or other third-party account directly to access their content.

It's possible that it might be ok on the basis that bitclout is a 3rd party service, but it will probably at least be a debate. I could see Apple digging their heels in and saying that since the google sign in is optional, and not required, that sign in with apple must also be presented as an option. I understand why it's not, but I'd rather not have to fight that battle in order to push a bug fix out.

A potential solution to all of the above might be to allow apps to specify a query parameter to the identity URL, e.g. allowGoogle=false to simply hide the log in with google button, which would let us opt out of that functionality until such a time as we can fully get it working. Currently we're not going to be able to update our app without adopting this.

@maebeam
Copy link
Contributor

maebeam commented May 31, 2021

Let's add ?google=false for now while we figure this stuff out.

@maebeam
Copy link
Contributor

maebeam commented May 31, 2021

I added ?hideGoogle=true for now

@andyboyd
Copy link
Contributor Author

andyboyd commented Jun 1, 2021

Thanks @maebeam, that's great as a stopgap solution. Happy to help you work on getting it working properly if you need it too.

@maebeam
Copy link
Contributor

maebeam commented Jun 1, 2021

@andyboyd let's start an email thread about how to make login with google and apple work well in mobile apps?

@maebeam
Copy link
Contributor

maebeam commented Jun 1, 2021

Well actually, with the change I pushed last night, it uses a redirect and should "just work" with a spoofed user agent. But I think the ideal solution is to figure out how to launch an ASWebAuthenticationSession.

@andyboyd
Copy link
Contributor Author

andyboyd commented Jun 1, 2021 via email

@maebeam
Copy link
Contributor

maebeam commented Jun 2, 2021

Yes, it's absolutely time for a native library.

@andyboyd
Copy link
Contributor Author

andyboyd commented Jun 7, 2021

@maebeam - it seems something has changed over the weekend, and now if hideGoogle=true is set, then there is no way to load a new account. If an account is already loaded into Identity, you can still log back into it, but you can't add another one. See the attached screenshot:

image

We'll need this to be fixed ASAP, no new users can sign up for our app with this issue, and existing users can't sign back in if they happen to have uninstalled.

@maebeam
Copy link
Contributor

maebeam commented Jun 7, 2021

Apologies! Will push a fix now

@maebeam
Copy link
Contributor

maebeam commented Jun 7, 2021

@andyboyd also, we changed the google flow to use a redirect instead of a pop up, so it should "just work" if you adjust the user agent accordingly

@andyboyd
Copy link
Contributor Author

andyboyd commented Jun 8, 2021

Thanks @maebeam . Do you happen to know what the user agent needs to be set to in order to work in the google flow? I imagine it just needs to pretend to be Safari, though I'm not sure how good a practice it is to spoof the user agent to pretend to be something you're not. I could see it leading to some unintended consequences, but I'll have a play around and see if it works now.

@maebeam
Copy link
Contributor

maebeam commented Jun 8, 2021

Yeah, just set it to any mobile safari UA. It should be totally fine.

@maebeam maebeam closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants