Expose provider name being used to log in
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- go
- Domain
- api, authentication
Research direction
Start by tracing the signIn entry point through authentication and access-token issuance, focusing on how app_metadata.provider is currently populated. Determine where the provider used for the current login can be exposed, then verify that the access token reports it consistently for email, magic link, phone, and third-party OAuth logins.
Written by the indexing model from the issue text.
Description
Feature request
Expose the name of the provider that's being used to authenticate a given user.
- A project can have 12 different ways to log in (email, magic link, phone, plus 9 third-party OAuth providers.)
- A user may sign up using one provider, say google, which results in the provider being set to
googlein the app_metatdata like this:
app_metadata: {
provider: "google"
}
- Then the user may later log in using the Facebook provider, but there's no easy way for the developer to know that the login came from Facebook, because the app_metadata will still always say 'google' as the provider.
Describe the solution you'd like
Adding the currently used provider name to the access token would be fine. Basically anywhere you can expose the name of the provider that was just used to authenticate the user would be fine. The use case here is to log each different provider a user has used to log in, to help troubleshoot authentication issues for a user.
"I tried to log in but it didn't work!" <-- would be much easier to troubleshoot if we could see they registered using email then logged in using twitter, then google, then github.
Describe alternatives you've considered
- We could log the
attemptto log in from the client, since the client sets the provider name when callingsupabase.auth.signIn(), but that's not a real login, that's just an attempt that might not be completed successfully. - We could add the provider to the
redirectToparameter of thesignIn()call:
redirectTo: `${window.location.origin}?provider=${provider}`
- This would require the developer to parse this information from the search part of the app's querystring, then make a second call back to the database to log this info
- This would also require that every possible provider is added to the
Additional Redirect URLs, which in an app with every possible auth provider, would make it a significant list. If you wanted to have redirect URLs for localhost (dev) and production, you might need 2 dozen or more redirect urls:http://localhost:8100?provider=facebook,http://localhost:8100?provider=googleetc.
- 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