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: Use Apple API for web auth on iOS, ASWebAuthenticationSession #611

Open
gnprice opened this issue Apr 2, 2024 · 0 comments
Open
Labels
a-first-hour Issues specific to using the app for the first time a-iOS Issues specific to iOS, or requiring iOS-specific work a-login
Milestone

Comments

@gnprice
Copy link
Member

gnprice commented Apr 2, 2024

This is a followup to:

In the version we merged as #600, web auth works great (as far as we've seen) on Android, and it works great on iOS… if you don't have the legacy zulip-mobile app installed.

If you do have the legacy app installed (or any other app that offers to handle zulip: URLs) then when you complete the server side of the auth flow and it tries to send you back to the app with your credentials, iOS may choose to have the other app handle it instead. There's no security issue here — the credentials are encrypted with a one-time pad the app generates and holds in memory — but it defeats your attempt to log in. And there's nothing the app can do about it, or that you can do about it short of uninstalling the other app.

To fix this, Apple offers a specialized API for this use case, ASWebAuthenticationSession. Docs here:
https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession
https://developer.apple.com/documentation/authenticationservices/authenticating_a_user_through_a_web_service

So we'd like to use that.

It doesn't appear there's a suitable package for this off the shelf. So we'll wrap the API ourselves, with Pigeon.

(Depending how that looks, we may in the future polish that wrapper up as a plugin package on pub.dev for other people to use. But that's out of scope for this issue.)

@gnprice gnprice added a-iOS Issues specific to iOS, or requiring iOS-specific work a-login a-first-hour Issues specific to using the app for the first time labels Apr 2, 2024
@gnprice gnprice added this to the Beta 2 milestone Apr 2, 2024
@gnprice gnprice modified the milestones: B2: pre-summer, Launch May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-first-hour Issues specific to using the app for the first time a-iOS Issues specific to iOS, or requiring iOS-specific work a-login
Projects
Status: No status
Development

No branches or pull requests

1 participant