PKCE Auth flow - java.lang.IllegalArgumentException
Hi, I recently switched to the PKCE auth flow, and I'm implementing a password reset screen. However, the
supabase.auth.parseSessionFromUrl()
function throws a java.lang.IllegalArgumentException
error and I have no clue why.
Logcat:
Code:
However, when I switch to implicit flow, it suddenly works. (The URL is also different).
Is there anyone who knows how can I make it work with PKCE?7 Replies
I don't know anything about the client you're using, but this sorta makes sense. I'm guessing the parse method is designed for implicit flow - which looks for the session in the url. Where as the pkce flow is looking for the
code
and then needs to exchange that and the code verifier (in storage) for the session.Do you know the name of the function which I should use instead?
I'd just be looking up docs, same as you.
On the javascript side, we'd send the post-auth redirect to a server api endpoint called /auth/callback, grab the
code
, and pass it to exchangeCodeForSession
either that or there is
SupabaseClient#handleDeeplinks(intent)
on AndroidWhat would you suggest for a multiplatform project targeting Wasm, Android and iOS?
Also, I wanted to ask if there is any way to find out whether to send the user to the password reset screen or just log the user in based on the PKCE code (or the session from it)
iOS has a similar method, Wasm works without much configuration.
You could use two different deep links, just override the redirect url when using the reset password method
Thank you!!