Back

OAuth2 with SwiftUI fails to save cookie

  • 0
  • Self Hosted
  • Auth
  • Apple
Timo
4 Jul, 2024, 17:57

Hi everyone,

I'm trying to integrate OAuth2 with the SDK for Apple. Everything works as expected, but somehow the session is not passed on to the app.

When executing the function, Safari opens as expected and displays the provider's login page. Upon successful authentication, it redirects to the Appwrite installation and asks to open the app. But here lies the problem: The app opens, and nothing happens. As far as I understand this issue, it does not execute the 'handleIncomingCookie' function, thus it is unable to log the user in.

I'm using SwiftUI.

Is there anything else that needs to be enabled or configured for this to work?

TL;DR
Issue with OAuth2 in SwiftUI: Safari opens for authentication, but the session is not passed to the app. The 'handleIncomingCookie' function seems not to be executing. Any additional configurations required? Solution: Ensure the 'handleIncomingCookie' function is correctly implemented and called upon app launch to save the session cookie. Check for any missing delegate setup to handle cookie responses.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more