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

feat: add a new example for oauth that uses webview #147

Merged
merged 12 commits into from
Feb 3, 2025

Conversation

totzk9
Copy link
Contributor

@totzk9 totzk9 commented Nov 4, 2024

This PR provides an example using webview.

The previous example wont work because OAuth providers like Google, Facebook and Apple doesn't acknowledge launchUrl as secure enough (It does work for flutter_web tho).

@totzk9
Copy link
Contributor Author

totzk9 commented Nov 4, 2024

This should provide another solution for #93

@dbarrosop dbarrosop requested a review from onehassan November 6, 2024 08:43
@dbarrosop
Copy link
Member

Nice, thanks. Will ask a colleague to review in the upcoming days. For the record, we are currently working on adding support for native authentication with hasura-auth so there will be no need of using a webview for apple/google sign in on ios/android.

@onehassan
Copy link
Contributor

Thank you @totzk9 for your contribution! 🙌

I encountered an issue while trying to run this on an iOS simulator. It seems there might be a problem with the url_launcher dependency.

Here’s the error I get:

/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.4/ios/Classes/Launcher.swift:20:1: error: type 'UIApplication' does not conform to protocol 'Launcher'
    extension UIApplication: Launcher {}

@totzk9
Copy link
Contributor Author

totzk9 commented Dec 2, 2024

I think we can close this PR since Nhost now supports idTokens for OAuth

@dbarrosop
Copy link
Member

Don't you need the webview for, let's say "Sign in with Apple" on android or "sign in with Google" on iOS"? Assuming you want to provide parity between iOS/Android applications.

@totzk9
Copy link
Contributor Author

totzk9 commented Dec 3, 2024

That does makes sense.
I was only looking on my use case and didn't thought of others - I also noticed some apps that uses webviews for auth (mostly mobile games).

Let me look on the issue mentioned above.

PS. Theres a plugin for iOS that can call native oauth for Google.
PPS. using webview for Sign in with Apple will still call the native dialog and still retain its form (cool move by Apple 😉)

@dbarrosop dbarrosop requested review from dbarrosop and removed request for onehassan January 31, 2025 11:35
@dbarrosop
Copy link
Member

@totzk9 is this one ready? not sure if you are still working on it. Happy to take a look and merge if ready

@dbarrosop dbarrosop assigned dbarrosop and unassigned onehassan Jan 31, 2025
@totzk9
Copy link
Contributor Author

totzk9 commented Jan 31, 2025

Hi there, yes this is finished

@dbarrosop
Copy link
Member

I am not entirely sure why but the CI seems quite broken :S

@totzk9
Copy link
Contributor Author

totzk9 commented Jan 31, 2025

I'll see what I can do

@totzk9
Copy link
Contributor Author

totzk9 commented Jan 31, 2025

@dbarrosop pushed some changes and tested from my fork.
Screenshot 2025-01-31 at 9 06 12 PM

You can run it again now

@dbarrosop
Copy link
Member

Thanks a lot, your contributions are highly appreciated.

@dbarrosop dbarrosop merged commit fb79943 into nhost:main Feb 3, 2025
19 checks passed
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

Successfully merging this pull request may close these issues.

3 participants