This is a demo application showing how to use signed messages with Firebase auth to manage login credentials in a decentralized way.
Live Demo *Demo may run slow on first call due to function cold starts.
It uses a React front-end to allow users to sign messages using a web3 browser wallet and then calls a Firebase cloud function to validate the signature and return login credentials.
Note
There is a hard coded variable in the front and and back end with a value of "Decentralized Login Phrase". Think of this as a seed, you may change it at any time, but it needs to be the same in both places.
The reason you'd want to change this is because a signed message's signature will always remain the same if the message being signed is the same, so you should rotate the login phrase regularly.
The front-end is built in React and requires you to set the firebase project configuration. See the front-end ReadMe file for instructions.
The back-end is built in Typescript using Firebase cloud functions. The back-end requires you to configure service account permissions. See back-end ReadMe file for instructions.
- Create a Firebase project. Tutorial
- Deploy the back-end (Firebase Functions) per instructions in functions ReadMe file.
- Deploy the front-end per instructions in the front-end ReadMe file.