By :Bharti Dua, Web App Intern, ETI Labs
FirebaseUI Authentication for Web
FirebaseUI is one of the libraries that provide easy login methods that include login directly using Google account, Facebook account, normal Email sign-in, and much more. You can use these built-in functionalities in your app with the utmost ease. It enables you to customize it as per your requirements since it is fully open-sourced.
In this blog, I’ll demonstrate how to use FirebaseUI auth to Sign-In and Sign-Up on the web. So let’s get started.
Steps are as follows:
- Go to Firebase console and add a project to follow the steps and create the project.
- On the left side menu, under the Develop section, select Authentication.
- Enable the Email-Password under the sign-in method tab.
- Now go to the Project Overview on the top left corner and copy the Firebase SDK snippet.
- Refer to the Firebase Docs or follow the Github link for much detailed information and customizing FirebaseUI. In this post, I have referred to the information in Github.
- Create a main.html file in the editor of your choice and copy the following code. In this code, I have used Email Link as the sign-in provider.
- In signInSuccessUrl, mention the URL you want to navigate to, after successful sign-in.Note: To execute, run it on a local server or use ‘firebase serve’ instead to test your app locally.Voila!
Now the user is authenticated, you can handle the upcoming flows as per your requirements.
Happy Coding 🙂