BUG: Firebase Auth/Import Users: a phone number field is missing in a user identity provider struct
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- go
- Domain
- authentication
Research direction
Start in auth/import_users.go around the UserProvider struct referenced in the issue and compare its fields with the linked Node.js reference. Add the missing phone-number representation with the shown JSON name, then verify that Firebase Auth user imports can serialize it correctly.
Written by the indexing model from the issue text.
Description
Environment
- Operating System version: macOS 13.2.1
- Firebase SDK version: Firebase Admin SDK v4
- Library version: v4.10.0
- Firebase Product: auth
A problem
We actively use Firebase Auth in a new project.
Some tools and services are written in Go.
We want to migrate existing users to Firebase.
So we use Firebase Auth's Import Users feature.
Almost all works well, but it is hard to test some cases because some info is missing in the docs.
That is why being looking through the Firebase Auth docs for other programming languages (https://firebase.google.com/docs/reference/admin/node/firebase-admin.auth.userproviderrequest.md#properties)
we figured out that a phoneNumber field is missing in the auth.UserProvider struct in Go version of the sdk.
Reproduce
Just take a look at Node.js' docs https://firebase.google.com/docs/reference/admin/node/firebase-admin.auth.userproviderrequest.md#properties
and at source codes of Go version https://github.com/firebase/firebase-admin-go/blob/1d245771f556db75b76b32a793b931be6f39c630/auth/import_users.go#L195
Relevant Code
The UserProvider struct should have all the fields that Node.js version has:
type UserProvider struct {
UID string `json:"rawId"`
ProviderID string `json:"providerId"`
Email string `json:"email,omitempty"`
PhoneNumber string `json:"phoneNumber,omitempty"` // missing field in current version
DisplayName string `json:"displayName,omitempty"`
PhotoURL string `json:"photoUrl,omitempty"`
}
A use case:
if p.Phone != nil {
providers = append(providers, &auth.UserProvider{
UID: p.ID.String(),
ProviderID: ProviderPhone,
PhoneNumber: *p.Phone,
DisplayName: displayName,
})
}
A main idea is the same fields should be used across all the implementations of the Firebase Admin API.
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 274
- Avg merge
- 10h 39m
- Merged PRs (30d)
- 2
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 firebase/firebase-admin-go
-
type: feature request
firebase/firebase-admin-go#772 · 1 assignee ·
-
api: auth type: bug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
firebase/firebase-admin-go#764 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
firebase/firebase-admin-go#736 ·
-
needs-triage
Difficulty 4/5 3-5 days Newbie friendliness 35/100
firebase/firebase-admin-go#722 · 2 comments · 3 reactions ·
-
needs-triage
Difficulty 4/5 3-5 days Newbie friendliness 42/100
firebase/firebase-admin-go#721 · 1 comment ·
All issues in firebase/firebase-admin-go
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100