diff --git a/examples/auth/flutter-mfa/README.md b/examples/auth/flutter-mfa/README.md index abcb23dab84..7e5b066e7de 100644 --- a/examples/auth/flutter-mfa/README.md +++ b/examples/auth/flutter-mfa/README.md @@ -1,6 +1,16 @@ # Flutter Supabase MFA Example -A simple app demonstrating how to implement Multi-Factor Authentication (MFA) with Supabase and Flutter. +![Flutter MFA with Supabase](https://raw.githubusercontent.com/supabase/supabase/main/examples/auth/flutter-mfa/images/mfa.png) + +A Flutter app demonstrating how to implement Multi-Factor Authentication (MFA) with Supabase and Flutter. A user can sign up, add MFA via an authenticator app, and only after they have signed in using MFA they can view the content from the database. + +- Full tutorial article [here](https://supabase.com/blog/flutter-authentication) + +## Getting Started + +- Create a new Supabase project [here](https://database.new) +- Add your Supabase credentials to `lib/main.dart` +- Run the following SQL from the SQL editor of your Supabase dashboard to create a table and dummy data ```sql -- Dummy table that contains "secure" information @@ -26,4 +36,13 @@ create policy "Users can view private_posts if they have signed in via MFA" for select to authenticated using (auth.jwt()->>'aal' = 'aal2'); -``` \ No newline at end of file +``` + +- Run the app and test the login flow 🚀 + +## Resources + +- [Flutter Authorization with RLS article](https://supabase.com/blog/flutter-authorization-with-rls) +- [Flutter Tutorial: building a Flutter chat app article](https://supabase.com/blog/flutter-tutorial-building-a-chat-app) +- [Supabase docs for Flutter](https://supabase.com/docs/reference/dart/introduction) +- [Supabase Flutter YouTube playlist](https://www.youtube.com/watch?v=F2j6Q-4nLEE&list=PL5S4mPUpp4OtkMf5LNDLXdTcAp1niHjoL) diff --git a/examples/auth/flutter-mfa/images/mfa.png b/examples/auth/flutter-mfa/images/mfa.png new file mode 100644 index 00000000000..0d13668601a Binary files /dev/null and b/examples/auth/flutter-mfa/images/mfa.png differ diff --git a/examples/auth/flutter-native-google-auth/README.md b/examples/auth/flutter-native-google-auth/README.md index 74afeb415db..e234f4578c3 100644 --- a/examples/auth/flutter-native-google-auth/README.md +++ b/examples/auth/flutter-native-google-auth/README.md @@ -1,5 +1,26 @@ -# Flutter authentication with Google and Supabase +# Flutter native Google auth with Supabase -A simple Flutter application with native Google login capabilities on iOS and Android. +![Flutter Google authentication with Supabase auth](https://raw.githubusercontent.com/supabase/supabase/main/examples/auth/flutter-native-google-auth/images/login.png) -You can find the full video guide [here](https://www.youtube.com/watch?v=YtvxRgGouwg) to learn the steps to implement native Google Login on your Flutter application using Supabase auth. +A simple Flutter application with native Google login capabilities on iOS and Android using Supabase auth. Upon signing in, the user is presented with a profile screen where their name and profile image from their Google account are displayed. + +- Full tutorial article [here](https://supabase.com/blog/flutter-authentication) +- Full video guide [here](https://www.youtube.com/watch?v=YtvxRgGouwg) + +## Getting Started + +- Create a new Supabase project [here](https://database.new) +- Add your Supabase credentials to `lib/main.dart` +- Obtain Google API client ID for [Android](https://developers.google.com/identity/sign-in/android/start-integrating#configure_a_project) and [iOS](https://developers.google.com/identity/sign-in/ios/start-integrating#get_an_oauth_client_id) +- Add the client IDs in Supabase dashboard under `Auth -> Providers -> Google -> Authorized Client IDs` and turn on `Enable Sign in with Google` +- Find the `clientId` variable in `lib/screens/login_screen.dart` and paste the two client IDs +- For android open `android/app/build.gradle` file, locate `appAuthRedirectScheme` variable and replace the value with your reversed DNS form of the Android client ID. For example, if your client ID is `1234567890-abc123def456.apps.googleusercontent.com`, then the value should be `com.googleusercontent.apps.1234567890-abc123def456` +- Run the app on iOS or Android and test the login flow 🚀 + +## Resources + +- [Flutter Authorization with RLS article](https://supabase.com/blog/flutter-authorization-with-rls) +- [Securing your Flutter apps with Multi-Factor Authentication article](https://supabase.com/blog/flutter-multi-factor-authentication) +- [Flutter Tutorial: building a Flutter chat app article](https://supabase.com/blog/flutter-tutorial-building-a-chat-app) +- [Supabase docs for Flutter](https://supabase.com/docs/reference/dart/introduction) +- [Supabase Flutter YouTube playlist](https://www.youtube.com/watch?v=F2j6Q-4nLEE&list=PL5S4mPUpp4OtkMf5LNDLXdTcAp1niHjoL) diff --git a/examples/auth/flutter-native-google-auth/images/login.png b/examples/auth/flutter-native-google-auth/images/login.png new file mode 100644 index 00000000000..2a64b8ade38 Binary files /dev/null and b/examples/auth/flutter-native-google-auth/images/login.png differ diff --git a/examples/auth/flutter-native-google-auth/lib/main.dart b/examples/auth/flutter-native-google-auth/lib/main.dart index 6c4e3f820c7..a7be2ac3f15 100644 --- a/examples/auth/flutter-native-google-auth/lib/main.dart +++ b/examples/auth/flutter-native-google-auth/lib/main.dart @@ -4,7 +4,6 @@ import 'package:supabase_flutter/supabase_flutter.dart'; void main() async { /// TODO: update Supabase credentials with your own - /// await Supabase.initialize( url: 'YOUR_SUPABASE_URL', anonKey: 'YOUR_ANON_KEY',