Skip to content

OAuth State Error for social providers since Supabase.Gotrue v6.1.0 #377

Description

@AndrewKahr

Bug report

Describe the bug

Since Supabase.Gotrue v6.1.0, there has been an issue where logging into social providers like Google and Apple fails due to a state error. The returned url parameters are ?error=invalid_request&error_code=bad_oauth_state&error_description=OAuth+state+parameter+is+invalid. If you manually remove the state argument from the url before trying to perform the sign-in, it works. This was seemingly introduced in supabase-community/gotrue-csharp@2de994c where it now always generates and adds a state value. Looking in the referenced modeled after link in the documentaion for GetUrlForProvider, it doesn't look like the auth-js version of the function creates or adds the state to the URL, which is likely why the issue is only surfacing here.

To Reproduce

Use the gotrue client to get a ProviderAuthState from client.SignIn. Then perform PKCE sign-in with the generated URL and you get redirected with the error instead of successfully signing in.

Expected behavior

Successfully sign in with the PKCE flow with providers like Google and Apple.

System information

  • OS: Windows
  • Browser: Chrome (started from csharp in Unity)
  • Version of supabase-csharp: 6.3.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions