I have set up OAuth with my Flutter app and Supabase. It works on the web… I sign in to the provider and I’m redirected to my website with the credential. However, in iOS, it does not work. I sign in to the provider and am still redirected to the website instead of the app. I added CFBundleURLSchemes
to the Info.plist
and associated domains, but that did not work. This is the function I use, which is what the Supabase example shows:
Supabase.auth.signInWithOAuth(
pkg.Provider.apple,
redirectTo: kIsWeb ? null : '<Bundle url>://login-callback/',
);
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>*bundle id*</string>
<string>domain.com</string>
</array>
</dict>
</array>
2
Answers
I found the issue. In a separate guide for Supabase, it mentions needing to add
'<Bundle url>://login-callback/'
as aredirect_url
on the server itself. With self-hosting, this shows up asADDITIONAL_REDIRECTURLS
in.env
.Did you add the scheme you used in the info.plist file? which is needed for the os to know to open URL with that scheme in this app. Which is as follows:
and this is the official doc about that