PricingBlog

Using providers with Supabase Auth

  • datomnz-1200266988740685874

    Tom Wrench

    2 years ago

    Has anybody successfully set up providers from Supabase Auth?

    I'm starting to look into adding options for signing in with Google, Apple and Facebook, but a bit stuck on how to handle them within toddle...
  • lucasg-1200268469913010257

    Lucas G

    2 years ago

    Which provider are you having trouble setting up?
  • datomnz-1200269181703168170

    Tom Wrench

    2 years ago

    Google initially, but would like to add in Facebook and Apple too.

    I'm fine with doing all the background stuff (Google cloud platform and entering the required credentials etc into Supabase for the provider). It's just more... what do I then link my 'sign in with Google' button to, to start the process?

    Possibly having a dull moment (it is late Friday afternoon here!)
  • lucasg-1200269340147204226

    Lucas G

    2 years ago

    Ah thankfully that's the easy part to answer for me 😅
  • https://<your-url>.supabase.co/auth/v1/authorize?provider=google&redirect_to=https://<your-site>.com
  • Your "Login with [PROVIDER]" button would link to that
  • datomnz-1200269794713280533

    Tom Wrench

    2 years ago

    Well that seems almost too simple! Thanks Lucas 🙂

    And then the user is given the usual supabase JWT token upon login?
  • lucasg-1200269897163341906

    Lucas G

    2 years ago

    Yeah supabase pretty much handles everythign after that
  • Sec let me pull up the doc
  • lucasg-1200270764797079572

    Lucas G

    2 years ago

    It is kind of confusing because reading the OAuth docs, it shows this URL:
  • https://<project-ref>.supabase.co/auth/v1/callback
  • To set up in the Authorized redirect URIs but then that other URL is mentioned in another part of the docs entirely
  • datomnz-1200271701913636964

    Tom Wrench

    2 years ago

    Yeah, slightly confusing! However, much more useful than the other doc I found (https://supabase.com/docs/guides/auth/social-login/auth-google).

    Awesome, I'm clocking off, but will give this a go next week! Cheers again for your help here. Have a 🍺 🙂