Firebase Service Provider Set up
Firebase allows you to easily add authentication to your application. Web3Auth supports Firebase as a service provider. You can create a verifier for Firebase and integrate it into your application. This page will help you set up Firebase as a service provider with Web3Auth.
Take a look at the supported social logins on Firebase
Create a Firebase Project
If you haven't already, create a Firebase project. It is the mandatory step before we proceed further. After the basic setup, we'll learn how to create a Firebase verifier for the Web3Auth project. You can follow the link below to set up Firebase for your project. For React native, you can set up Firebase for Android and iOS separately. If we are missing any platform/framework, you can always check out Firebase documentation.
Create a Firebase Verifier
Create a Firebase Verifier from the Custom Authentication tab of your Web3Auth Project.
-
Click on the
Custom Authentication
tab of your Web3Auth Project. -
Click on the
Create Verifier
button. -
Enter a name of your choice for the verifier identifier.
eg. w3a-firebase-demo
-
Select
Custom Providers
from the Choose a Login Provider section. -
JWKS Endpoint: Enter
https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com
as the JWKS endpoint for the Firebase. -
Now you have the option to paste a sample idToken(JWT) to get the fields for the JWT validation. This step is optional, but if you have a sample JWT you can paste it here to get the fields for the JWT validation. You can also skip this step and fill in the fields manually.
-
The following are the JWT validation fields needed for the Firebase JWT validation:
- Type
iss
as a field andhttps://securetoken.google.com/FIREBASE-PROJECT-ID
as a value. - Next, type
aud
as a field andFIREBASE-PROJECT-ID
as a value.
Note: Replace the
FIREBASE-PROJECT-ID
with your Firebase Project ID. - Type
-
Next, Select
Sub
,Email
or aCustom
value from the dropdown for the JWT Verifier ID. This is the field that will be used as the verifier ID for the user, and it has to be unique for each user. -
Finally, Click on the
Create
button to create your verifier.
It may take up to 10 minutes to deploy the verifier on sapphire_devnet. You'll receive an email once it's complete.
Explore Guides
After you have set up Firebase and the corresponding verifier in the Web3Auth Dashboard, you can follow the guides to integrate it into your project. The support for using a custom verifier is not limited to the below SDKs and platforms. You can check out our SDK references to learn how to use a custom verifier.