Sign in with Apple using Supabase Auth | Supabase Swift Series

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ส.ค. 2024
  • In this series, we will be covering all things Supabase & Swift. In this video, we go through Supabase Auth and implement sign in with Apple in our SwiftUI app.
    SwiftUI Chat App (Firebase Login Example): • FULL COURSE SwiftUI Ch...
    Series Playlist: • Supabase Swift Series
    Let me know in the comment section what videos you would like to see in the future. Feel free to reach out to me if you need any help or advice. Happy Coding :)
    Follow Me On Twitter: / jasondubonyt
    Follow Me On IG: / thedubon
    0:00 Intro
    1:22 Login with Apple Documentation
    2:20 Project Setup
    4:20 Sign In ViewModel
    5:25 Sign in with Apple
    22:20 Access Current User/Session
    23:37 Refactoring our Code
    29:30 HomeView & Sign in flow
    32:25 Outro
    #supabaseswift #supabase #swift
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @jasondubon
    @jasondubon  11 หลายเดือนก่อน +2

    if you get an issue with .signInWithIdToken function you can bring in this import:
    @_spi(Experimental) import GoTrue

  • @malifraz8945
    @malifraz8945 ปีที่แล้ว +3

    Goated with the sauce

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

    awesome video as always.

  • @jordanhowlett9172
    @jordanhowlett9172 ปีที่แล้ว +2

    dude this is genius, aint no way I would have figured this out! Thanks!

    • @jasondubon
      @jasondubon  ปีที่แล้ว

      Glad I could help!

  • @iggypacanowski
    @iggypacanowski ปีที่แล้ว

    Man I love you. Been working on this today, and couldn't make those SafariViews to work properly, freakin' Callback URLs... it works perfectly now!

    • @jasondubon
      @jasondubon  ปีที่แล้ว

      😂😂 That’s great! Glad it was helpful

  • @Anthony-dev
    @Anthony-dev ปีที่แล้ว

    Thank you for this tutorial, I completed it. I don't have a developer account so I wasn't able to get the flow working to completion where it printed the session, once the popup asked for my apple id password nothing happens when clicking sign in. I will try this again once my Developer account is set up though.
    This was a really helpful walk-through covering a niche use case that is hard to find documentation on.
    Thank you!
    Subscribed.

    • @jasondubon
      @jasondubon  ปีที่แล้ว

      Im glad you found it helpful! Let me know if you have any issues. Initially it seemed like it was not supported and then I did some playing around and searching and voila!

  • @Kittymemesdaily
    @Kittymemesdaily ปีที่แล้ว +2

    Thank you for posting this! Do you have a github repository for reference to double check syntax of each script in this tutorial example?

    • @jasondubon
      @jasondubon  ปีที่แล้ว +1

      Hey Shantalia, I have not uploaded the code yet. Will upload it once finished with series (so in about 2 weeks or so)

    • @jasondubon
      @jasondubon  ปีที่แล้ว +3

      I added some of the sign in with apple files to github github.com/MexJason/Supabase-SignInWithApple
      If you were facing any issues with that

    • @matthewcampbell4047
      @matthewcampbell4047 10 หลายเดือนก่อน

      @@jasondubon The code here isn't usable its missing AuthManager

    • @jasondubon
      @jasondubon  10 หลายเดือนก่อน +1

      @@matthewcampbell4047 Hey matt, check this repo bro, github.com/MexJason/SupabaseSwift/tree/main

  • @benjenkins2415
    @benjenkins2415 3 วันที่ผ่านมา +1

    Really interesting. I am stuck at enabling Apple login within Supabase. I know you said the Secret Key doesn't matter, but I can't save it without something there. What did you do? It needs some JWT.

    • @benjenkins2415
      @benjenkins2415 2 วันที่ผ่านมา

      For any interested, I found the solution. It's convoluted, but I had to sign in to my Apple Dev account, create a key file, generate a secret key (via Ruby) and then update Supabase. It worked, but, man, it's a slog.

    • @abdulazizdavurov1206
      @abdulazizdavurov1206 15 ชั่วโมงที่ผ่านมา

      @@benjenkins2415 hi can you share code. I am facing same problem. I generated auth key file and stuck there cannot find secret key

  • @louistrumpbour4396
    @louistrumpbour4396 ปีที่แล้ว +1

    Using the supabase-swift 0.3.0 package. signInWithIdToken() throws the error: 'signInWithIdToken' is inaccessible due to '@_spi' protection level
    This tutorial is very helpful and the intent is obvious. I'm guessing the dev team is trying to enforce one of their other signIn methods for what you have accomplished here.

    • @jasondubon
      @jasondubon  ปีที่แล้ว +3

      Hey, thanks for watching and the update! I will look into this, they made some changes recently which may be causing this.

    • @tinnietv6615
      @tinnietv6615 ปีที่แล้ว +1

      @@jasondubon Yeah I am now also getting the same error. Epic tutorial as well by the way!

    • @anton_n
      @anton_n ปีที่แล้ว

      @jasondubon It seems like signInWithIdToken is marked as experimental. I solved this by adding this to my imports:
      @_spi(Experimental) import GoTrue

    • @TheBishopOfBarton
      @TheBishopOfBarton 11 หลายเดือนก่อน +1

      @@anton_n I had the same problem, and that solved it for me. Thank you.

    • @jasondubon
      @jasondubon  11 หลายเดือนก่อน +1

      @@anton_n thanks anton!! this is a great work around! I wish Supabase would fix it to help us get native sign in capabilities.

  • @RobertEvansII
    @RobertEvansII 10 หลายเดือนก่อน

    I ran into an issue using the extension and topVC not found. I assigned ASAuthorizationControllerPresentationContextProviding to the SignInApple class and then added
    func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor {
    return UIApplication.shared.windows.first! // Return an appropriate presentation anchor
    }

    • @jasondubon
      @jasondubon  10 หลายเดือนก่อน +1

      This is good to know, thanks for sharing!

    • @RobertEvansII
      @RobertEvansII 10 หลายเดือนก่อน

      @@jasondubon welcome and overall great video

  • @georgebarlowr
    @georgebarlowr ปีที่แล้ว +2

    Is it possible to drop the source code, even just for the SignInApple file. I'm getting a few UI API called on a background thread error messages, I'm sure it is a mistake I've made, but would be great just to clarify exactly what you did to avoid these. The error essentially is coming from the getTopViewController function in the extension of UIApplication. My initial instinct was to wrap the areas in a DispatchQueue.main.async {} closure, but I noticed you didn't need to do that so therefore I'm sure I've just missed a step.
    Excellent video though, really informative, really agree that this should be within the Supabase documentation too considering the reason most develop in Swift to begin with is for its native feel, when compared with some of the web framework based, mobile app development alternatives.

    • @jasondubon
      @jasondubon  ปีที่แล้ว

      Hey George just seeing this now. I’ll make sure to upload a copy of it to GitHub tomorrow morning. I’m not near my computer but i think i added the @MainActor to the sign in view model to help with errors like those. Will confirm later And thanks for watching!

    • @jasondubon
      @jasondubon  ปีที่แล้ว +2

      Here is the link to the repo: github.com/MexJason/Supabase-SignInWithApple

    • @pepa007
      @pepa007 ปีที่แล้ว

      @@jasondubon came for this too. Thank man. And thanks for the video!

    • @pepa007
      @pepa007 ปีที่แล้ว

      @@jasondubon actually would you mind sharing the rest of the code too? seems like I'm making some stupid mistakes somewhere. Thank you!