How to implement Google sign-in on Flutter with Supabase on iOS, Android & Web

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ส.ค. 2024
  • Integrate Google Auth with Supabase in Your Cross-Platform Flutter App
    - Supabase Google sign-in docs → supabase.com/docs/guides/auth...
    Google sign-in is a common way for a user to sign into applications, and it is almost like a requirement these days to have it in your app. Supabase auth makes it easy to implement Google sign-in on your app so that you can securely log your users into your app. This video walks through how to implement Google sign-in with Flutter on different platforms.
    Chapters:
    00:00 Intro
    00:18 Create a new Flutter project
    00:49 Set up google_sign_in with Firebase
    01:40 Set up google_sign_in without Firebase
    02:55 Implement the native Google sign-in flow
    08:09 Verify that Google sign-in works on iOS and Android
    08:54 Set up Google sign-in for the Web
    11:32 Wrap up
    💻 Videos to watch next:
    ▶ Build a SaaS with Supabase in minutes: • Fastest way to build a...
    ▶Watch all Supabase Flutter tutorials: • Getting Started with F...
    ▶ Create a Figma clone app with Supabase in seconds: • Draw and sync canvas i...
    ▶ Supabase real-time with Flutter: • Listening to real-time...
    If you want to streamline user onboarding and secure your Flutter app with Google Auth and Supabase, we’ve got you covered. This Supabase tutorial video will help you simplify the sign-up process to your app, increasing the chance of conversions and enhance app security by integrating Google sign-in with Supabase across iOS and Android apps. Learn the step-by-step process, from obtaining essential client IDs to configuring web-specific settings, and discover how to handle platform-specific considerations for a seamless experience on iOS, Android, and web. At the end of this video, you’ll be able to integrate Google sign-in, improve user experience (which is ALWAYS a good thing) and increase security on your app - all within the user-friendly Supabase platform.
    What you will learn:
    ✅ Client ID Configuration: Grasp the process of obtaining essential client IDs for Web, Android, and iOS platforms, a crucial step for enabling Google sign-in within Supabase.
    ✅ Web-Specific Considerations: Explore the unique configurations required for seamless Google sign-in functionality on the web platform, including authorized redirect URLs and client secrets.
    ✅Supabase Integration: Learn how to connect and leverage Supabase's functionalities to handle ID tokens and user authentication seamlessly during the Google sign-in process.
    After this video you will be able to:
    ✅Integrate Google Auth Sign-in To Supabase: Confidently add Google sign-in functionality to your Flutter app with Supabase, enabling users to leverage their familiar Google credentials for a smooth and secure login experience.
    ✅ Simplify User Onboarding: Reduce the need for registration forms which will lead to increased conversions.
    ✅ Enhance Security with Google Authentication: Enjoy robust security features of Google authentication to safeguard user data and prevent unauthorized access within your Flutter app using Supabase.
    Learn more about Supabase 👇
    - Website: supabase.com/?...
    - Get started: app.supabase.com/?...
    - Docs: supabase.com/docs?...
    🔔 Subscribe for more tutorials and feature updates from Supabase: / @supabase
    📱 Connect with Us:
    - Github: github.com/supabase?...
    - Discord: discord.supabase.com/?...
    - Twitter: supabase/?...
    ABOUT SUPABASE:
    Supabase is the open source Firebase alternative. Supabase provides a full Postgres database for every project with pgvector, backups, realtime, and more. Add and manage email and password, passwordless, OAuth, and mobile logins to your project through a suite of identity providers and APIs.
    Build in a weekend, scale to millions.
    #Supabase #AppDevelopment #RealtimeApps #DeveloperTools
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 56

  • @dshukertjr
    @dshukertjr 5 หลายเดือนก่อน +13

    Apple sign-in video will also come out soonish. In the mean while, what other Flutter content would you like to see on this channel?

    • @TheDevLogger
      @TheDevLogger 5 หลายเดือนก่อน +2

      Would love to see a tutorial for desktop with deep linking!

    • @xeooox
      @xeooox 5 หลายเดือนก่อน

      The guide and document are awesome. Thank you.
      1. How to handle refresh and access tokens in real app scenarios (Retrieving and revoking a session in real-world scenarios).
      2. Implementing pagination with infinite scroll using Supabase PostgreSQL.

    • @dmitrygutoryan2915
      @dmitrygutoryan2915 5 หลายเดือนก่อน

      The same video but when we deploy supabase on the local machine

    • @dshukertjr
      @dshukertjr 5 หลายเดือนก่อน +1

      @@TheDevLogger Great suggestion! Deep link deep dive is something I would like to work on. Added it to my list!

    • @dshukertjr
      @dshukertjr 5 หลายเดือนก่อน

      @@xeooox Thank you so much for the compliment. What exactly would you like to see about handling refresh and access tokens? Using Supabase, you shouldn't really have to worry about handling refresh or access tokens (unless you want to revoke it like you mention). Retrieving the tokens should happen automatically by the SDK, and you should never have to worry about or handle it yourself. Are you finding yourself to be in a position where you have to handle it by yourself?

  • @user-ri4fy9kg2t
    @user-ri4fy9kg2t 5 หลายเดือนก่อน +3

    Very helpful video, thank you!

  • @indiechatofficial
    @indiechatofficial 5 หลายเดือนก่อน +1

    Beautiful !!!

  • @nikitachernenko3774
    @nikitachernenko3774 3 หลายเดือนก่อน +2

    dude, you saved my day!! It was pretty non-obvious for me before where I need to use android service id vs web service id, and why it is web service id for android if I use native sign in...
    mobile dev is slightly confusing, but thanks a lot!!

  • @luis96xd
    @luis96xd 3 หลายเดือนก่อน

    Thanks for the tutorial!

  • @hantuedan4541
    @hantuedan4541 4 หลายเดือนก่อน

    thankyou so much, I appreciate this a lot 🙏

  • @freddy9292
    @freddy9292 2 หลายเดือนก่อน

    thank you!!

  • @eliuddyn
    @eliuddyn 5 หลายเดือนก่อน +2

    Amazing 🔥🔥

  • @footzi8756
    @footzi8756 15 วันที่ผ่านมา +1

    Great 🎉

  • @Kamal_sabki
    @Kamal_sabki 3 หลายเดือนก่อน

    thanks! i have an issue redirecting the users to the right page, i want to to redirect the user to continue the onborinf and completing the user information when they clic on sigup and if they clic on login with google they will be redirect to home. do you have anyidea on how to achieve this ?

  • @kamil_supabase_enjoyer
    @kamil_supabase_enjoyer 5 หลายเดือนก่อน +3

    ❤❤❤

  • @OviDB
    @OviDB 5 หลายเดือนก่อน +1

    Just a note, you're pointing to Google Singin with Flutter video, is that the video you're mentioning?

    • @dshukertjr
      @dshukertjr 5 หลายเดือนก่อน

      Sorry, are you talking about the video or somewhere in the docs?

  • @Shreyas-fs3dp
    @Shreyas-fs3dp 5 หลายเดือนก่อน

    Can we please get a compose multiplatform google + apple sign in tutorial?

  • @gkumartube
    @gkumartube 5 หลายเดือนก่อน +2

    i see charge for MAU in pricing, why ?

    • @dshukertjr
      @dshukertjr 5 หลายเดือนก่อน +1

      We have a wide range of Auth features that we offer with it like MFA, SSO, OAuth with 19 different providers, and we need to sustain it. It comes with a pretty generous free tier though.

    • @gkumartube
      @gkumartube 4 หลายเดือนก่อน

      @@dshukertjrThanks

  • @michaelrogers6935
    @michaelrogers6935 3 หลายเดือนก่อน

    This was quite clear for the most part, but there were 3 different client IDs, which one gets pasted into Supabase?

    • @Supabase
      @Supabase  3 หลายเดือนก่อน

      Three different client IDs all have different purposes, and they are all required if you want to support all web, iOS and Android. As shown in the video, the one you paste into the Supabase dashboard is the web Client ID.

    • @muratcan__22
      @muratcan__22 3 หลายเดือนก่อน

      ​@@Supabase why do we not paste it to Client ID (for OAuth) but to the authorized clientIds?

  • @user-jm5qu3gd4l
    @user-jm5qu3gd4l หลายเดือนก่อน

    It seems I haven't found a tutorial for Sign in with Apple using Supabase and Flutter.
    By the way, how can I link multiple OAuth logins to the same account? I mean binding both Apple and Google to the same account.
    Of course, it should also work for Web and Android

    • @user-jm5qu3gd4l
      @user-jm5qu3gd4l หลายเดือนก่อน

      I apologize first, I didn't see that you also wrote 'Apple sign-in video will also come out soonish.' Sorry.

  • @excellencemichel4875
    @excellencemichel4875 5 หลายเดือนก่อน +2

    Supabase have to add the crucial feature for all real word app like transaction native feature or batch on db. Otherwise we can't chose supabase to to make a good apps.

    • @Supabase
      @Supabase  5 หลายเดือนก่อน

      Actually, transaction is supported through Postgres functions. You can create a Postgres function and call it using the .rpc method from the client. Batched writes have been always possible using the standard insert or upsert method on the client libraries!

    • @excellencemichel4875
      @excellencemichel4875 5 หลายเดือนก่อน

      For a big project that need many transaction operations which take two or three table with many field is not easy. Maybe you have your reason but that lack of this features is a big issue.

  • @lordew9476
    @lordew9476 19 วันที่ผ่านมา +1

    dont work on web but in android is fine... who can display gmail not this numbers?

    • @Supabase
      @Supabase  19 วันที่ผ่านมา

      Are you calling the .signInWithOAuth() method on web? What numbers are you seeing instead of gmail accounts?

    • @lordew9476
      @lordew9476 15 วันที่ผ่านมา +1

      @@Supabase I did everything as in the video, after clicking the button the method works, but Google gave the following error: "401 invalid client", "flowName=GeneralOAuthFlow". I see this error only on the web when I open the application through a browser; in the Android emulator everything works fine. I will be glad for any hint! Thank you! this numbers is after Auth displayed in page, i don't know how display user Gmail.

  • @wgolyoko
    @wgolyoko 3 หลายเดือนก่อน

    This does not work. I created a new Firebase project, enabled Google Sign In, but there cas no Google Cloud project created.

    • @Supabase
      @Supabase  3 หลายเดือนก่อน

      Creating a Firebase project always creates a GCP project in the background, so maybe you are looking into the wrong GCP org or something. Navigating through GCP console might not be easy if you are not used to it, but look around and you should find the corresponding GCP project!

  • @Supabase
    @Supabase  5 หลายเดือนก่อน

    Get the docs here: - Supabase Google sign-in docs → supabase.com/docs/guides/auth/social-login/auth-google?platform=flutter&Mg6fVmX0U

  • @NoPr0gress
    @NoPr0gress 11 วันที่ผ่านมา

    helped to fix web , i didnt know i have to set the port

    • @Supabase
      @Supabase  9 วันที่ผ่านมา

      Flutter web changes the port every single time you run it, so it's either specifying the port like in the video, or adjusting your code every single time you run it locally.

  • @user-pg8wf6sc9d
    @user-pg8wf6sc9d 3 หลายเดือนก่อน

    The google_sign_in plugin `signIn` method is deprecated on the web, and will be removed in Q2 2024.

    • @Supabase
      @Supabase  3 หลายเดือนก่อน

      Google sign-in on the web with Flutter does not use the google_sign_in plugin, but rather uses supabase.auth.signInWithOAuth() method, so it will not be affected by the deprecation.

  • @devagarwal3250
    @devagarwal3250 4 หลายเดือนก่อน +1

    i am getting error cliend id not found

    • @dshukertjr
      @dshukertjr 4 หลายเดือนก่อน

      If you could precisely share the exact error message and the platform you are running it on, I might be able to assist you better, but it most likely is due to not configuring one of the configurations correctly. There are iOS, Android, and Web client ID that you need to handle in order to implement Google sign-in, which is quite confusing, so take you time, watch back the video, and make sure you have added all the correct configuration in the correct place.

    • @devagarwal3250
      @devagarwal3250 4 หลายเดือนก่อน

      ​@@dshukertjr I am only using an Android client, and I have done the exact same thing and copied the exact same code from the video.
      the one thing I excluded was web client and ios client

    • @dshukertjr
      @dshukertjr 4 หลายเดือนก่อน +1

      @@devagarwal3250 Okay, well creating a web client ID is a requirement for supporting Google sign-in on Android. At 03:19, you can see me adding the Web Client ID into the dashboard.

    • @devagarwal3250
      @devagarwal3250 4 หลายเดือนก่อน +1

      @@dshukertjr In the flutter code also it is necessary to put the web client ID?

    • @dshukertjr
      @dshukertjr 4 หลายเดือนก่อน

      @@devagarwal3250 Yes, you do.

  • @giaretz92
    @giaretz92 4 หลายเดือนก่อน

    The login on iOS works perfectly but the one on Android doesn't work. It keeps giving me the same error [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null)

    • @Supabase
      @Supabase  4 หลายเดือนก่อน +1

      That error most likely means that you are providing the wrong SHA1 certificate fingerprint to GCP. Double check that you are providing the correct one, and you should be good to go.