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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

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
Member

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 😉)

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