Files
supabase/examples/auth/flutter-native-google-auth
2023-07-12 21:13:10 +09:00
..
2023-07-11 15:44:42 +09:00
2023-07-12 21:13:10 +09:00

Flutter native Google auth with Supabase

Flutter Google authentication with 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
  • Full video guide here

Getting Started

  • Create a new Supabase project here
  • Add your Supabase credentials to lib/main.dart
  • Obtain Google API client ID for Android and iOS
  • 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