firebase / firebase/firebase-admin-node

firebase-auth updateUser with providerToLink using "password" as providerId

Open
#1,592 7 comments 0 reactions 0 assignees View on GitHub
api: auth
Dominant language
TypeScript
Stars
1.7k
Forks
419
Avg merge
3d 10h
Merged PRs (30d)
16

Description

Hey I'm trying to link providerData with providerId = "password" using firebase admin SDK

environment :
* Firebase SDK version: 10.0.2
* Firebase Product: auth
* Node.js version: 16.13.0
* NPM version: 8.1.0

The problem
I'm trying to link providerData using firebase admin SDK in order to link providerData with providerId = "password" .
I'm using updateUser method and pass providerToLink object in order to link providerData.
updateUser method will return this error :
- code : auth/invalid-provider-id
- message : The providerId must be a valid supported provider identifier string.

Relevant Code:

```
await admin
.auth()
.updateUser(user.uid, {
providerToLink: {
uid: user.email,
email: user.email,
displayName: user.displayName,
providerId: 'password',
},
})
.catch((error: any) => {
console.error(`${error}`);
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.