Support custom OAuth parameters or configurable auth URL from frontend
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- go, typescript
- Domain
- authentication, authorization
Research direction
Start from the frontend signInWithOAuth entry point described in the issue and trace how the OAuth authorization URL is generated. Done means supporting per-login custom parameters or a configurable authorization URL for providers such as Azure, with the behavior covering the multi-tenant example.
Written by the indexing model from the issue text.
Description
Supabase Auth should support passing custom parameters (such as tenant, login_hint, or other provider-specific params) to the OAuth authorization URL directly from the frontend.
Alternatively, there should be a way to override or extend the generated auth URL at runtime on a per-login basis.
Problem
Currently, when using Supabase Auth’s OAuth providers (like Microsoft, Google, etc.), the redirect URL is fully managed by Supabase. While this works for most single-tenant cases, it limits flexibility for multi-tenant or dynamic login experiences.
For example, with Azure AD, Supabase always sends users to:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
But for multi-tenant apps, users often belong to different Azure AD tenants, and should be redirected to:
https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize
This tenant ID cannot currently be set from the frontend. Similarly, there’s no way to add parameters like login_hint (which improves user experience by pre-filling the email address). It can be set from the backend but this wont work for multi tenant apps that are on one project.
What’s missing
A way to use customParameters for each oauth provider or to modify the provider authorization URL
For example, something like this would solve the problem:
await supabase.auth.signInWithOAuth({
provider: 'azure',
options: {
tenantId: 'hello.onmicrosoft.com'
}
});
Or, alternatively, an API to override the base authorization URL:
await supabase.auth.signInWithOAuth({
provider: 'azure',
options: {
authUrl: https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/authorize
}
});
Why this is needed
Multi-tenant apps often require per-organization authentication flows (different Azure AD tenant IDs).
Improved UX: Adding login_hint helps prefill or restrict users’ login context.
Parity with other SDKs: For instance, Firebase allows this with https://firebase.google.com/docs/auth/web/microsoft-oauth#handle_the_sign-in_flow_with_the_firebase_sdk
provider.setCustomParameters({ tenant: 'TENANT_ID', login_hint: 'user@contoso.com' });
Flexibility for future providers: This feature would generalize well to other OAuth providers that use custom parameters.
Possible approaches
I think Supabase should really step up here and look at how Firebase did this, their solution is quite robust.
Or at least expose a hook/callback that lets the developer modify the auth URL before redirect.
Example use case
A multi-tenant SaaS app where each tenant (organization) has its own Azure AD tenant ID configured in the app. When their users click “Login with Microsoft,” they should be redirected to their correct tenant login page — not the generic Microsoft /common login.
- Dominant language
- Go
- Stars
- 2.6k
- Forks
- 764
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 39
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/auth
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100