Skip to content

signInWithOAuth custom provider incorrect redirect_uri #2477

Open

Description

@barrownicholas

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Edit 2: opened pr

#2478

Edit 1: I traced the issue to this line:

redirectURL := config.API.ExternalURL + "/callback"

Original Description

When attempting to call supabase.auth.signInWithOAuth using a custom OIDC provider, the redirect_uri is incorrect. The value being set is {API_EXTERNAL_URL}/callback, instead of {API_EXTERNAL_URL}/auth/v1/callback

Image

Even if I set the redirect_uri to {API_EXTERNAL_URL}/callback, it returns an error:

Image

But if I manually change it to {API_EXTERNAL_URL}/auth/v1/callback`, it works:

Image Image

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Create a custom OIDC provider, following these steps: https://supabase.com/docs/guides/auth/custom-oauth-providers?queryGroups=language&language=js&queryGroups=setup-method&setup-method=js#oidc-provider
  2. Attempt to login, seeing that redirect_uri param is wrong

Expected behavior

The redirect_uri parameter should be {API_EXTERNAL_URL}/auth/v1/callback (/auth/v1/callback), not simply /callback.

System information

  • OS: macOS 26.3.1 (a) (25D771280a)
  • Browser (if applies): chrome 146.0.7680.178
  • Version of supabase-js: ^2.103.0
  • Version of Node.js: v25.9.0

Activity

  1. added
    bug
    on Apr 11, 2026
  2. barrownicholas commented on Apr 11, 2026

    @barrownicholas
    Author

    To note, I am using the CLI (2.84.2) and the value in auth (v2.188.1) is "API_EXTERNAL_URL=http://127.0.0.1:54321"

  3. aantti commented on Apr 11, 2026

    @aantti

    I think this might be on the CLI's side - to configure a new route in Kong, @jgoux / @avallete?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions