Export/Import Auth Users w/ Custom Claims

82 views
Skip to first unread message

chris wales

unread,
Mar 14, 2019, 11:26:30 PM3/14/19
to Firebase Google Group
Hello,

Is there a way with the CLI to export auth users with any custom claims they may have and then import those into a new project?

Thanks,

Chris

Kato Richardson

unread,
Mar 15, 2019, 12:23:11 PM3/15/19
to Firebase Google Group
Hi Chris,

Looks like this is an open feature request. As a workaround, you could export/import the users, and then use the Admin SDK to read the custom claims for each entry in the file and apply them manually against the new DB. Might be tedious and slow.

Reading the custom claims is covered here, and is done using getUser() and userRecord.customClaims.admin.

☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/d5099f95-3b43-482a-bec5-8765b818be8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

chris wales

unread,
Mar 16, 2019, 5:33:34 PM3/16/19
to Firebase Google Group
Thanks Kato! Glad to hear its on the radar would be really useful.

Kato Richardson

unread,
Mar 18, 2019, 11:26:13 AM3/18/19
to Firebase Google Group
Note that listUsers() is probably simpler for iterating the user accounts than my suggestion of reading the exported ids from the file.

☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages