Pyrebase icon indicating copy to clipboard operation
Pyrebase copied to clipboard

Unable to create a custom ID token without a service account

Open alvindraper opened this issue 5 years ago • 1 comments

Im getting the error AttributeError: 'NoneType' object has no attribute 'service_account_email'. I looked this up and saw that a service account was needed. Was a method where you can use a normal email and give it its own custom id developed?

alvindraper avatar Aug 23 '20 13:08 alvindraper

pyrebase cant send auth data. you need cloud function functions.auth.user().onCreate(user => ...

you can view the function and a working project or Easy Base with Ready to use Cloud Functions https://github.com/DizzyduckAR/LoginBase/blob/main/LoginBase%20Cloud%20Functions/index.js

once you upload the func to your project with firebase CLI any user registered on auth will get the const customClaims = { "NickName": "Free Pirate", "Time": "Free", "Token": "Free" };

into the real time DB with his UID as key (you can view the DB on the main readme.md

DizzyduckAR avatar Oct 29 '20 09:10 DizzyduckAR