© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•6mo ago•
9 replies
oli

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()
supabase.auth.parseSessionFromUrl()
function throws a
java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
error and I have no clue why.

Logcat:
B1: https://myapp.com/callback?code=55793db3-8770-8980-81ee-9477db9c3f04
Deep link handling exception: java.lang.IllegalArgumentException: No access token found
B1: https://myapp.com/callback?code=55793db3-8770-8980-81ee-9477db9c3f04
Deep link handling exception: java.lang.IllegalArgumentException: No access token found


Code:
    fun handleDeepLink(url: String) {
        screenModelScope.launch {
            try {
                log.error { "B1: $url" }
                val session = supabaseClient.auth.parseSessionFromUrl(url)
                log.error { "B2" }
                supabaseClient.auth.importSession(session)
 
            } catch (e: Exception) {
                log.error { "Deep link handling exception: $e" }
                snackbarManager.sendMessage("Failed to open link: ${e.message}")
            }
        }
    }
    fun handleDeepLink(url: String) {
        screenModelScope.launch {
            try {
                log.error { "B1: $url" }
                val session = supabaseClient.auth.parseSessionFromUrl(url)
                log.error { "B2" }
                supabaseClient.auth.importSession(session)
 
            } catch (e: Exception) {
                log.error { "Deep link handling exception: $e" }
                snackbarManager.sendMessage("Failed to open link: ${e.message}")
            }
        }
    }


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?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Password Reset PKCE Flow
SupabaseSSupabase / help-and-questions
13mo ago
Email Auth with PKCE flow for SSR redirectTo Not Working
SupabaseSSupabase / help-and-questions
3y ago
Failed to start session: pkce(Auth.AuthError.PKCEFailureReason.invalidPKCEFlowURL)
SupabaseSSupabase / help-and-questions
6mo ago
pkce flow for passwordless sign in problem with magic link url
SupabaseSSupabase / help-and-questions
8mo ago