SlideShare a Scribd company logo
Set up Email
Authentication Using
React Native +
Firebase Auth + React
Navigation
www.bacancytechnology.com
Build Rect Native App
Install required dependencies for
Navigation
Setting Up Firebase Project
Creating Components
Table of Contents
1. Overview: React Native Firebase Tutorial
2. What are we building?
3. Firebase Authentication Example: Steps
to Implement React Native + Firebase Auth
4. Conclusion
Overview
This beginners’ guide will help you
build a React Native application and
integrate it with Firebase. Furthermore,
we will set up email authentication
with Firebase in React Native. We all
have heard how smoothly we can build
native applications using React Native.
Let’s combine its flexibility with
Firebase and get started with this
tutorial to implement email
authentication and React Navigation
using React Native + Firebase auth.
https://youtu.be/F66J0_TrjDM
What are we
building?
We are building a basic React Native
application integrated with Firebase
Authentication that consists of Sign Up,
Login/Logout, Forgot Password, and User
Profile.
Here is the flow for authenticating a user –
whenever the user accesses the app, it will
contain the authentication state, and based
on that state; the user will have access to the
screen or the services of the app. Based on
this condition, authenticated and non-
authenticated users will have access to
different screens accordingly. Here in our
demo, we will implement authentication on
the Profile screen. It means that only an
authenticated user will visit its Profile page;
else, it will have only access to Sign Up and
Sign In screens.
Without further ado, let’s start coding!
React Native +
Firebase Auth
Example: Steps
to Implement
Firebase
Authentication
You can visit here – Github Repository and
check the code or go through this tutorial.
Follow these steps to build a React Native
app and implement Firebase
Authentication.
Create React Native App
Initially, we will create a React Native app using-
react-native init FirebaseAuth
Install required
dependencies for
Navigation
We will require stack navigation for
navigating through different screens.
npm install react-native-gesture-handler react-
native-safe-area-context @react-
navigation/native @react-navigation/stack
After this, we need to install the React
Native Firebase auth library to implement
authentication with Firebase in our react
app.
npm install @react-native-firebase/auth
Let’s set-up our Firebase Project.
Setting Up Firebase
Project
First, we need to create a Firebase Project.
Visit the official Firebase website and click
on Get Started. There you can create your
new project. After that, you will be
redirected to the Dashboard to use
Authentication Service.
Here are the images that will help you
understand the above process.
Click on the authentication on the side
menu
Select Sign-in Methods
In our app, we have to set up authentication
for email/password. For that, follow these
steps-
Select email and passwords
Enable Email and Password
Authentication by toggling the button
Provide the support mail
Save
I’ve attached an image below for your
reference.
To configure our app with Firebase, go
to the Project Dashboard, Add an app to
the project, and follow the proper steps.
Now we have all the details related to
Firebase configuration. Store these
configurations in a file named
FirebaseInfo.js
import firebase from @react-
native-firebase/auth
const firebaseInfo={
apiKey:'Your API Key',
appId:'Your App Id',
messagingSenderId:'Your
Sender Id',
projectId:'Your Project Id',
}
// FirebaseInfo.js
And then initialize the app using:
firebase.initializeApp(firebaseinfo)
Creating Components
Let’s get started with creating
components for our application. As it’s
basic authentication, it will consist of the
following components-
SignUp, Login/Logout, ResetPassword,
User Details of the currently logged-in
user, and a Navigator to move between
screens.
After entering the required details,
whenever a user clicks on the SignUp
button, it will validate and check if there is
an error related to the email registration.
Here is the logic for implementing the Sign
Up process.
Sign Up
const OnSignUp= async(email,password)=>{
Keyboard.dismiss()
if(!email)
{
Alert.alert("Email can't be empty");
}
else if(!EmailRegex.test(email))
{
Alert.alert("Email is not in the right
format")
}
else if(!password && password.trim() &&
password.length<5)
{
Alert.alert("Password is too weak and
required min 6 characters")
}
else{
try{
const Email=await
firebase.auth().createUserWithEmailAndPas
sword(email,password)
Email.user.updateProfile({displayName:use
rname})
Email.user.reload()
setusername("")
setemail("")
setpassword("")
props.navigation.navigate('Login')
}
catch(error)
{
console.log("error", error.message,
error.code)
switch (error.code)
{
case "auth/weak-password":
Alert.alert("Password is invalid,requires
min 6 char")
break;
case "auth/email-already-in-use":
Alert.alert("Email is already registered")
break;
default:
Alert.alert("Error")
}
}
}
}
Log In
Similarly, the Login screen will verify
if the user is authenticated or not. It
can be verified with the given
parameters (email, password):
const AuthUser = await
firebase.auth().signInWithEmailAndPa
ssword(email, password)
Log Out
For Log Out, we will revoke the access
from the user and let him sign out
from the app with this:
await firebase.auth().signOut()
Forget Password
If you don't remember your password,
Forget Password screen lets you recover
your password using your email-id where
Firebase will share a link to reset your
password using:
await
firebase.auth().sendPasswordResetEm
ail(email)
User Profile
The user profile will display user details (of
the logged-in user) such as email-id and
user name entered a48t the time of Sign
Up:
var
EmailId=firebase.auth().currentUser.email;
var
User=firebase.auth().currentUser.displayNa
me;
Conclusion
This was about setting up email/ password
authentication and React Navigation using
React Native + Firebase Auth. I hope the
purpose for landing on this tutorial has
been fulfilled as you've expected. If you are
looking to develop one-of-a-kind React
Native application, then get in touch with
us to hire React Native developer from us
to leverage to leverage our top-notch React
Native app development services.
Thank You
www.bacancytechnology.com

More Related Content

PPTX
QuizBrahma by Sagar Kadam
PPTX
Integrate drupal 8 with alexa - Rakshith
PPT
Omniauth
PPTX
Accessibility with Single Page Apps
PPTX
Wordpress user name directions
PDF
StackMob & Appcelerator Module Part One
PPT
Ajax Highlights
PPTX
Brewing Beer with Windows Azure - NDC2013
QuizBrahma by Sagar Kadam
Integrate drupal 8 with alexa - Rakshith
Omniauth
Accessibility with Single Page Apps
Wordpress user name directions
StackMob & Appcelerator Module Part One
Ajax Highlights
Brewing Beer with Windows Azure - NDC2013

What's hot (20)

PDF
Salary advanceworkflow
PDF
An introduction to AngularJS
PDF
Ajax learning tutorial
PPT
Introduccion app engine con python
PPTX
Lightning Talk - Clean Architecture and Design
PPTX
Mule integration with linkedin
DOC
Create Applicationwith IIS 7
PDF
How to implement multiple authentication guards in laravel 8
DOC
Expense personalization
PDF
How to get AWS student credit
PDF
EasiShare AWS Setup Guide
PDF
Invoicing app on ribily
PPSX
Filters in Mule Part-3 Message Property Filter
PPT
2310 b 16
PDF
Write Tests in End Users’ Lingo
PDF
The A1 by Christian John Felix
PDF
JSChannel 2017 - Service Workers and the Role they Play in modern day web-apps
PDF
Building mobile applications with Vaadin TouchKit
PDF
Web driver selenium simplified
PDF
Mobile web apps in pure Java
Salary advanceworkflow
An introduction to AngularJS
Ajax learning tutorial
Introduccion app engine con python
Lightning Talk - Clean Architecture and Design
Mule integration with linkedin
Create Applicationwith IIS 7
How to implement multiple authentication guards in laravel 8
Expense personalization
How to get AWS student credit
EasiShare AWS Setup Guide
Invoicing app on ribily
Filters in Mule Part-3 Message Property Filter
2310 b 16
Write Tests in End Users’ Lingo
The A1 by Christian John Felix
JSChannel 2017 - Service Workers and the Role they Play in modern day web-apps
Building mobile applications with Vaadin TouchKit
Web driver selenium simplified
Mobile web apps in pure Java
Ad

Similar to Set up email authentication using react native + firebase auth + react navigation (20)

PDF
Email authentication using firebase auth + flutter
PDF
Full Angular 7 Firebase Authentication System
PPTX
Telerik AppBuilder Presentation for TelerikNEXT Conference
PDF
Creating azure logic app for salesforce integration | Webner
PDF
Passport js authentication in nodejs how to implement facebook login feature ...
PDF
End-to-end Mobile App Development (with iOS and Azure Mobile Services)
PPTX
pptindustrial (1).pptx
PPTX
Introduction to Firebase [Google I/O Extended Bangkok 2016]
PDF
Cloud Messaging Flutter
PDF
Laravel mail example how to send an email using markdown template in laravel 8
PDF
Android Quiz App – Test Your IQ.pdf
PDF
How React Native Appium and me made each other shine
PDF
How to Create a Shopify Omnichannel Customer Support Inbox App.pdf
PDF
How to Implement Token Authentication Using the Django REST Framework
PDF
React Native Firebase Realtime Database + Authentication
PDF
How to build twitter bot using golang from scratch
PPTX
IRREPORT.pptx
PPT
PDF
Introduction to React for Frontend Developers
DOC
Cis407 a ilab 5 web application development devry university
Email authentication using firebase auth + flutter
Full Angular 7 Firebase Authentication System
Telerik AppBuilder Presentation for TelerikNEXT Conference
Creating azure logic app for salesforce integration | Webner
Passport js authentication in nodejs how to implement facebook login feature ...
End-to-end Mobile App Development (with iOS and Azure Mobile Services)
pptindustrial (1).pptx
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Cloud Messaging Flutter
Laravel mail example how to send an email using markdown template in laravel 8
Android Quiz App – Test Your IQ.pdf
How React Native Appium and me made each other shine
How to Create a Shopify Omnichannel Customer Support Inbox App.pdf
How to Implement Token Authentication Using the Django REST Framework
React Native Firebase Realtime Database + Authentication
How to build twitter bot using golang from scratch
IRREPORT.pptx
Introduction to React for Frontend Developers
Cis407 a ilab 5 web application development devry university
Ad

More from Katy Slemon (20)

PDF
React Alternatives Frameworks- Lightweight Javascript Libraries.pdf
PDF
Data Science Use Cases in Retail & Healthcare Industries.pdf
PDF
How Much Does It Cost To Hire Golang Developer.pdf
PDF
What’s New in Flutter 3.pdf
PDF
Why Use Ruby On Rails.pdf
PDF
How Much Does It Cost To Hire Full Stack Developer In 2022.pdf
PDF
How to Implement Middleware Pipeline in VueJS.pdf
PDF
How to Build Laravel Package Using Composer.pdf
PDF
Sure Shot Ways To Improve And Scale Your Node js Performance.pdf
PDF
How to Develop Slack Bot Using Golang.pdf
PDF
IoT Based Battery Management System in Electric Vehicles.pdf
PDF
Understanding Flexbox Layout in React Native.pdf
PDF
The Ultimate Guide to Laravel Performance Optimization in 2022.pdf
PDF
New Features in iOS 15 and Swift 5.5.pdf
PDF
How to Hire & Manage Dedicated Team For Your Next Product Development.pdf
PDF
Choose the Right Battery Management System for Lithium Ion Batteries.pdf
PDF
Flutter Performance Tuning Best Practices From the Pros.pdf
PDF
Angular Universal How to Build Angular SEO Friendly App.pdf
PDF
How to Set Up and Send Mails Using SendGrid in NodeJs App.pdf
PDF
Ruby On Rails Performance Tuning Guide.pdf
React Alternatives Frameworks- Lightweight Javascript Libraries.pdf
Data Science Use Cases in Retail & Healthcare Industries.pdf
How Much Does It Cost To Hire Golang Developer.pdf
What’s New in Flutter 3.pdf
Why Use Ruby On Rails.pdf
How Much Does It Cost To Hire Full Stack Developer In 2022.pdf
How to Implement Middleware Pipeline in VueJS.pdf
How to Build Laravel Package Using Composer.pdf
Sure Shot Ways To Improve And Scale Your Node js Performance.pdf
How to Develop Slack Bot Using Golang.pdf
IoT Based Battery Management System in Electric Vehicles.pdf
Understanding Flexbox Layout in React Native.pdf
The Ultimate Guide to Laravel Performance Optimization in 2022.pdf
New Features in iOS 15 and Swift 5.5.pdf
How to Hire & Manage Dedicated Team For Your Next Product Development.pdf
Choose the Right Battery Management System for Lithium Ion Batteries.pdf
Flutter Performance Tuning Best Practices From the Pros.pdf
Angular Universal How to Build Angular SEO Friendly App.pdf
How to Set Up and Send Mails Using SendGrid in NodeJs App.pdf
Ruby On Rails Performance Tuning Guide.pdf

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Cloud computing and distributed systems.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Modernizing your data center with Dell and AMD
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
A Presentation on Artificial Intelligence
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Teaching material agriculture food technology
Spectral efficient network and resource selection model in 5G networks
Cloud computing and distributed systems.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Chapter 3 Spatial Domain Image Processing.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Understanding_Digital_Forensics_Presentation.pptx
Electronic commerce courselecture one. Pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Monthly Chronicles - July 2025
Modernizing your data center with Dell and AMD
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Review of recent advances in non-invasive hemoglobin estimation
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Unlocking AI with Model Context Protocol (MCP)
Per capita expenditure prediction using model stacking based on satellite ima...
A Presentation on Artificial Intelligence
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Advanced methodologies resolving dimensionality complications for autism neur...

Set up email authentication using react native + firebase auth + react navigation

  • 1. Set up Email Authentication Using React Native + Firebase Auth + React Navigation www.bacancytechnology.com
  • 2. Build Rect Native App Install required dependencies for Navigation Setting Up Firebase Project Creating Components Table of Contents 1. Overview: React Native Firebase Tutorial 2. What are we building? 3. Firebase Authentication Example: Steps to Implement React Native + Firebase Auth 4. Conclusion
  • 4. This beginners’ guide will help you build a React Native application and integrate it with Firebase. Furthermore, we will set up email authentication with Firebase in React Native. We all have heard how smoothly we can build native applications using React Native. Let’s combine its flexibility with Firebase and get started with this tutorial to implement email authentication and React Navigation using React Native + Firebase auth. https://youtu.be/F66J0_TrjDM
  • 6. We are building a basic React Native application integrated with Firebase Authentication that consists of Sign Up, Login/Logout, Forgot Password, and User Profile. Here is the flow for authenticating a user – whenever the user accesses the app, it will contain the authentication state, and based on that state; the user will have access to the screen or the services of the app. Based on this condition, authenticated and non- authenticated users will have access to different screens accordingly. Here in our demo, we will implement authentication on the Profile screen. It means that only an authenticated user will visit its Profile page; else, it will have only access to Sign Up and Sign In screens. Without further ado, let’s start coding!
  • 7. React Native + Firebase Auth Example: Steps to Implement Firebase Authentication
  • 8. You can visit here – Github Repository and check the code or go through this tutorial. Follow these steps to build a React Native app and implement Firebase Authentication. Create React Native App Initially, we will create a React Native app using- react-native init FirebaseAuth
  • 9. Install required dependencies for Navigation We will require stack navigation for navigating through different screens. npm install react-native-gesture-handler react- native-safe-area-context @react- navigation/native @react-navigation/stack After this, we need to install the React Native Firebase auth library to implement authentication with Firebase in our react app. npm install @react-native-firebase/auth Let’s set-up our Firebase Project.
  • 10. Setting Up Firebase Project First, we need to create a Firebase Project. Visit the official Firebase website and click on Get Started. There you can create your new project. After that, you will be redirected to the Dashboard to use Authentication Service. Here are the images that will help you understand the above process.
  • 11. Click on the authentication on the side menu Select Sign-in Methods In our app, we have to set up authentication for email/password. For that, follow these steps-
  • 12. Select email and passwords Enable Email and Password Authentication by toggling the button Provide the support mail Save I’ve attached an image below for your reference. To configure our app with Firebase, go to the Project Dashboard, Add an app to the project, and follow the proper steps.
  • 13. Now we have all the details related to Firebase configuration. Store these configurations in a file named FirebaseInfo.js
  • 14. import firebase from @react- native-firebase/auth const firebaseInfo={ apiKey:'Your API Key', appId:'Your App Id', messagingSenderId:'Your Sender Id', projectId:'Your Project Id', } // FirebaseInfo.js And then initialize the app using: firebase.initializeApp(firebaseinfo)
  • 15. Creating Components Let’s get started with creating components for our application. As it’s basic authentication, it will consist of the following components- SignUp, Login/Logout, ResetPassword, User Details of the currently logged-in user, and a Navigator to move between screens.
  • 16. After entering the required details, whenever a user clicks on the SignUp button, it will validate and check if there is an error related to the email registration. Here is the logic for implementing the Sign Up process. Sign Up const OnSignUp= async(email,password)=>{ Keyboard.dismiss() if(!email) { Alert.alert("Email can't be empty"); } else if(!EmailRegex.test(email)) { Alert.alert("Email is not in the right format") } else if(!password && password.trim() && password.length<5) {
  • 17. Alert.alert("Password is too weak and required min 6 characters") } else{ try{ const Email=await firebase.auth().createUserWithEmailAndPas sword(email,password) Email.user.updateProfile({displayName:use rname}) Email.user.reload() setusername("") setemail("") setpassword("") props.navigation.navigate('Login') } catch(error) {
  • 18. console.log("error", error.message, error.code) switch (error.code) { case "auth/weak-password": Alert.alert("Password is invalid,requires min 6 char") break; case "auth/email-already-in-use": Alert.alert("Email is already registered") break; default: Alert.alert("Error") } } } }
  • 19. Log In Similarly, the Login screen will verify if the user is authenticated or not. It can be verified with the given parameters (email, password): const AuthUser = await firebase.auth().signInWithEmailAndPa ssword(email, password) Log Out For Log Out, we will revoke the access from the user and let him sign out from the app with this: await firebase.auth().signOut()
  • 20. Forget Password If you don't remember your password, Forget Password screen lets you recover your password using your email-id where Firebase will share a link to reset your password using: await firebase.auth().sendPasswordResetEm ail(email)
  • 21. User Profile The user profile will display user details (of the logged-in user) such as email-id and user name entered a48t the time of Sign Up: var EmailId=firebase.auth().currentUser.email; var User=firebase.auth().currentUser.displayNa me;
  • 22. Conclusion This was about setting up email/ password authentication and React Navigation using React Native + Firebase Auth. I hope the purpose for landing on this tutorial has been fulfilled as you've expected. If you are looking to develop one-of-a-kind React Native application, then get in touch with us to hire React Native developer from us to leverage to leverage our top-notch React Native app development services.