SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
Firebase Auth 101
Authentication using Firebase SDK
+ +
++
github.com/aqidd
Bukhori Muhammad Aqid
+ +
++
+ +
++
Firebase Auth : Some Capabilities
https://firebase.google.com/docs/auth/
+ +
++
+ +
++
Firebase Auth : Key Capabilities
https://firebase.google.com/docs/auth/
● Firebase UI
provides a drop-in auth solution that handles the UI flows for signing in users with email addresses and passwords, Google
Sign-In, and Facebook Login.
● Email & Password Authentication
● Federated identity provider integration
● Custom Auth Integration
Connect your app's existing sign-in system to the Firebase Authentication SDK and gain access to Firebase Realtime Database
and other Firebase services.
● Anonymous Auth
Use Firebase features that require authentication without requiring users to sign in first by creating temporary anonymous
accounts. If the user later chooses to sign up, you can upgrade the anonymous account to a regular account, so the user can
continue where they left off.
+ +
++
+ +
++
Firebase Console : Create Project
https://console.firebase.google.com
+ +
++
+ +
++
Facebook Developer : Create Project
https://developers.facebook.com
+ +
++
Firebase
Console :
Enable Auth
https://console.firebase.google.com/
+ +
++
+ +
++
1. Create a Firebase project in the Firebase console, if you don't already have one. If you already have an
existing Google project associated with your mobile app, click Import Google Project. Otherwise, click Create
New Project.
2. Click Add Firebase to your Android app and follow the setup steps. If you're importing an existing Google
project, this may happen automatically and you can just download the config file.
3. When prompted, enter your app's package name. It's important to enter the package name your app is
using; this can only be set when you add an app to your Firebase project.
4. At the end, you'll download a google-services.json file. You can download this file again at any time.
5. If you haven't done so already, copy this into your project's module folder, typically app/.
Integrate Firebase into your App
https://firebase.google.com/docs/android/setup
+ +
++
+ +
++
● Add rules to your root-level build.gradle file, to include the google-services plugin
● Then, in your module Gradle file (usually the app/build.gradle), add the apply plugin line at the bottom of the
file to enable the Gradle plugin
Add Firebase SDK
+ +
++
+ +
++
● Declare the FirebaseAuth and AuthStateListener objects.
● Initialize the FirebaseAuth instance and the AuthStateListener method so you can track whenever the user
signs in or out.
Integrate Firebase Auth
https://firebase.google.com/docs/auth/android/start/
+ +
++
+ +
++
● Attach the listener to your FirebaseAuth instance in the onStart() method and remove it on onStop().
You can also add the listener in onAttach() method & remove it on onDetach() if you’re using Fragment
Integrate Firebase Auth (2)
https://firebase.google.com/docs/auth/android/start/
+ +
++
+ +
++
● Create a new account by passing the new user's email address and password to
createUserWithEmailAndPassword
If the new account was created, the user is also signed in, and the AuthStateListener runs the onAuthStateChanged
callback. In the callback, you can use the getCurrentUser method to get the user's account data.
Registering a User
https://firebase.google.com/docs/auth/android/password-auth
+ +
++
+ +
++
● When a user signs in to your app, pass the user's email address and password to
signInWithEmailAndPassword
If sign-in succeeded, the AuthStateListener runs the onAuthStateChanged callback. In the callback, you can use the
getCurrentUser method to get the user's account data.
Logging In a User
https://firebase.google.com/docs/auth/android/password-auth
+ +
++
+ +
++
● When a user signs in to your app, pass the user's email address to sendPasswordReset
If password reset succeeded, Firebase will send an email to your account for a password reset steps.
Forgot Password
+ +
++
Integrate Facebook Login to your App
Facebook Login
+ +
++
+ +
++
1. Add mavenCentral() to your Module-level /app/build.gradle before dependencies
2. Add the compile dependency with the latest version of the Facebook SDK in the build.gradle file
compile 'com.facebook.android:facebook-android-sdk:4.+'
3. Build your project. Import com.facebook.FacebookSdk into your app.
4. Initialize Facebook SDK before you can use it. Add a call to FacebookSdk.sdkInitialize from onCreate in your
Application class
FacebookSdk.sdkInitialize(getApplicationContext());
AppEventsLogger.activateApp(this);
5. add your Facebook App ID to your project's strings file and update your Android manifest
6. Add a meta-data element to the application element
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
Integrate Facebook SDK into your App
https://developers.facebook.com/docs/android/getting-started
+ +
++
+ +
++
Set your Native Platform data
Configure your Facebook App
https://developers.facebook.com/docs/android/getting-started
+ +
++
+ +
++
On OSX
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1
-binary | openssl base64
On Windows
keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%.androiddebug.keystore | openssl
sha1 -binary | openssl base64
On Android Studio :
Getting your Key Hash Value
https://developers.facebook.com/docs/android/getting-started
+ +
++
+ +
++
Configure your Facebook Login Parameter
Configure your Facebook App
https://developers.facebook.com/docs/android/getting-started
+ +
++
+ +
++
● Create CallbackManager Instance
● Register CallbackManager onActivityResult()
Using Facebook Login Button
https://developers.facebook.com/docs/facebook-login/android/v2.2
+ +
++
+ +
++
● Add Facebook Login Button to your XML File
● Customize the properties of Login button and register CallbackManager
Using Facebook Login Button (2)
https://developers.facebook.com/docs/facebook-login/android/v2.2
+ +
++
+ +
++
● After a user successfully signs in, in the LoginButton's onSuccess callback method, get an access token for the
signed-in user, exchange it for a Firebase credential, and authenticate with Firebase using the Firebase credential
Integrate Facebook Login with Firebase
https://firebase.google.com/docs/auth/android/facebook-login
+ +
++
Clone Sample Project at :
https://github.com/aqidd/firebase-auth-sample
+ +
++
Clone Complete Project at :
https://github.com/aqidd/firebase-auth-sample/tree/develop
Thank you. Let’s talk!
www.flipbox.co.id
021 739 6426 • 0818 0725 2399
contact@flipbox.co.id
+ +
++

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Firebase Overview
Firebase OverviewFirebase Overview
Firebase Overview
 
Google Firebase
Google FirebaseGoogle Firebase
Google Firebase
 
Firebase PPT
Firebase PPTFirebase PPT
Firebase PPT
 
Introduction to Firebase with Android and Beyond...
Introduction to Firebase with Android and Beyond...Introduction to Firebase with Android and Beyond...
Introduction to Firebase with Android and Beyond...
 
Firebase
FirebaseFirebase
Firebase
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Firebase in action 2021
Firebase in action 2021Firebase in action 2021
Firebase in action 2021
 
Firebase
Firebase Firebase
Firebase
 
Web api
Web apiWeb api
Web api
 
Firebase - A real-time server
Firebase - A real-time serverFirebase - A real-time server
Firebase - A real-time server
 
Introducing firebase
Introducing firebaseIntroducing firebase
Introducing firebase
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Introduction to Firebase
Introduction to FirebaseIntroduction to Firebase
Introduction to Firebase
 
Firebase Introduction
Firebase Introduction Firebase Introduction
Firebase Introduction
 
Rest API
Rest APIRest API
Rest API
 
OpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerOpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of Swagger
 
Architecture: Microservices
Architecture: MicroservicesArchitecture: Microservices
Architecture: Microservices
 
What Is An SDK?
What Is An SDK?What Is An SDK?
What Is An SDK?
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Firebase slide
Firebase slideFirebase slide
Firebase slide
 

Andere mochten auch

Жизнь в спектре аутизма и за его пределами
Жизнь в спектре аутизма и за его пределамиЖизнь в спектре аутизма и за его пределами
Жизнь в спектре аутизма и за его пределами
rooiperspektiva
 

Andere mochten auch (20)

A-Z Web Development Concept
A-Z Web Development ConceptA-Z Web Development Concept
A-Z Web Development Concept
 
Firebase for the Web
Firebase for the WebFirebase for the Web
Firebase for the Web
 
Montreal Girl Geeks: Building the Modern Web
Montreal Girl Geeks: Building the Modern WebMontreal Girl Geeks: Building the Modern Web
Montreal Girl Geeks: Building the Modern Web
 
Creating Business Value - Use Cases in CPG/Retail
Creating Business Value - Use Cases in CPG/RetailCreating Business Value - Use Cases in CPG/Retail
Creating Business Value - Use Cases in CPG/Retail
 
Firebase
FirebaseFirebase
Firebase
 
Wearable - storytelling or storydoing - Yiannis Lapatas
Wearable - storytelling or storydoing - Yiannis LapatasWearable - storytelling or storydoing - Yiannis Lapatas
Wearable - storytelling or storydoing - Yiannis Lapatas
 
The Rise of Wearable Technology
The Rise of Wearable Technology  The Rise of Wearable Technology
The Rise of Wearable Technology
 
Engineering your culture how to keep your engineers happy
Engineering your culture   how to keep your engineers happyEngineering your culture   how to keep your engineers happy
Engineering your culture how to keep your engineers happy
 
3D print for manufacturing
3D print for manufacturing3D print for manufacturing
3D print for manufacturing
 
Webinar - AWS 201 IoT with AWS - Smart devices powered by the cloud
Webinar - AWS 201 IoT with AWS - Smart devices powered by the cloudWebinar - AWS 201 IoT with AWS - Smart devices powered by the cloud
Webinar - AWS 201 IoT with AWS - Smart devices powered by the cloud
 
How to build Android Chat App with Firebase for 2 hours?
How to build Android Chat App with Firebase for 2 hours?How to build Android Chat App with Firebase for 2 hours?
How to build Android Chat App with Firebase for 2 hours?
 
Жизнь в спектре аутизма и за его пределами
Жизнь в спектре аутизма и за его пределамиЖизнь в спектре аутизма и за его пределами
Жизнь в спектре аутизма и за его пределами
 
Composer the right way
Composer the right wayComposer the right way
Composer the right way
 
Liferay + Wearables
Liferay + WearablesLiferay + Wearables
Liferay + Wearables
 
10 things being 3 d printed right now
10 things being 3 d printed right now10 things being 3 d printed right now
10 things being 3 d printed right now
 
Debugging and Tuning Mobile Web Sites with Modern Web Browsers
Debugging and Tuning Mobile Web Sites with Modern Web BrowsersDebugging and Tuning Mobile Web Sites with Modern Web Browsers
Debugging and Tuning Mobile Web Sites with Modern Web Browsers
 
Internet Search Tips featuring Google
Internet Search Tips featuring GoogleInternet Search Tips featuring Google
Internet Search Tips featuring Google
 
Using the internet for search
Using the internet for searchUsing the internet for search
Using the internet for search
 
Bad websites
Bad websitesBad websites
Bad websites
 
How to develop modern web application framework
How to develop modern web application frameworkHow to develop modern web application framework
How to develop modern web application framework
 

Ähnlich wie Firebase Auth Tutorial

Google external login setup in ASP (1).pdf
Google external login setup in ASP  (1).pdfGoogle external login setup in ASP  (1).pdf
Google external login setup in ASP (1).pdf
findandsolve .com
 

Ähnlich wie Firebase Auth Tutorial (20)

React Native Firebase Realtime Database + Authentication
React Native Firebase Realtime Database + AuthenticationReact Native Firebase Realtime Database + Authentication
React Native Firebase Realtime Database + Authentication
 
Hooking SharePoint APIs with Android
Hooking SharePoint APIs with AndroidHooking SharePoint APIs with Android
Hooking SharePoint APIs with Android
 
Full Angular 7 Firebase Authentication System
Full Angular 7 Firebase Authentication SystemFull Angular 7 Firebase Authentication System
Full Angular 7 Firebase Authentication System
 
What is new in Firebase?
What is new in Firebase?What is new in Firebase?
What is new in Firebase?
 
Xhacker firebase
Xhacker firebaseXhacker firebase
Xhacker firebase
 
Raspberry pi and Google Cloud
Raspberry pi and Google CloudRaspberry pi and Google Cloud
Raspberry pi and Google Cloud
 
Using Java to interact with Firebase in Android
Using Java to interact with Firebase in AndroidUsing Java to interact with Firebase in Android
Using Java to interact with Firebase in Android
 
Google external login setup in ASP (1).pdf
Google external login setup in ASP  (1).pdfGoogle external login setup in ASP  (1).pdf
Google external login setup in ASP (1).pdf
 
Flutter Festival IIT Goa: Session IV
Flutter Festival IIT Goa: Session IVFlutter Festival IIT Goa: Session IV
Flutter Festival IIT Goa: Session IV
 
Fire up your mobile app!
Fire up your mobile app!Fire up your mobile app!
Fire up your mobile app!
 
Introduction to facebook java script sdk
Introduction to facebook java script sdk Introduction to facebook java script sdk
Introduction to facebook java script sdk
 
Angular 11 google social login or sign in tutorial using angularx social-login
Angular 11 google social login or sign in tutorial using angularx social-loginAngular 11 google social login or sign in tutorial using angularx social-login
Angular 11 google social login or sign in tutorial using angularx social-login
 
Intro to Firebase Realtime Database and Authentication
Intro to Firebase Realtime Database and AuthenticationIntro to Firebase Realtime Database and Authentication
Intro to Firebase Realtime Database and Authentication
 
Download PowerPoint Project on social programming for engineering students
Download PowerPoint Project on social programming for engineering studentsDownload PowerPoint Project on social programming for engineering students
Download PowerPoint Project on social programming for engineering students
 
Email authentication using firebase auth + flutter
Email authentication using firebase auth + flutterEmail authentication using firebase auth + flutter
Email authentication using firebase auth + flutter
 
App Indexing: Blurring the Lines Between Your Website and App
App Indexing: Blurring the Lines Between Your Website and AppApp Indexing: Blurring the Lines Between Your Website and App
App Indexing: Blurring the Lines Between Your Website and App
 
Creating an Uber Clone - Part XXXIII - Transcript.pdf
Creating an Uber Clone - Part XXXIII - Transcript.pdfCreating an Uber Clone - Part XXXIII - Transcript.pdf
Creating an Uber Clone - Part XXXIII - Transcript.pdf
 
Apresentação firebase
Apresentação firebaseApresentação firebase
Apresentação firebase
 
Cloud Messaging Flutter
Cloud Messaging FlutterCloud Messaging Flutter
Cloud Messaging Flutter
 
Devfest SouthWest, Nigeria - Firebase
Devfest SouthWest, Nigeria - FirebaseDevfest SouthWest, Nigeria - Firebase
Devfest SouthWest, Nigeria - Firebase
 

Kürzlich hochgeladen

Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Cara Menggugurkan Kandungan 087776558899
 

Kürzlich hochgeladen (6)

Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 

Firebase Auth Tutorial

  • 1. Firebase Auth 101 Authentication using Firebase SDK
  • 3. + + ++ + + ++ Firebase Auth : Some Capabilities https://firebase.google.com/docs/auth/
  • 4. + + ++ + + ++ Firebase Auth : Key Capabilities https://firebase.google.com/docs/auth/ ● Firebase UI provides a drop-in auth solution that handles the UI flows for signing in users with email addresses and passwords, Google Sign-In, and Facebook Login. ● Email & Password Authentication ● Federated identity provider integration ● Custom Auth Integration Connect your app's existing sign-in system to the Firebase Authentication SDK and gain access to Firebase Realtime Database and other Firebase services. ● Anonymous Auth Use Firebase features that require authentication without requiring users to sign in first by creating temporary anonymous accounts. If the user later chooses to sign up, you can upgrade the anonymous account to a regular account, so the user can continue where they left off.
  • 5. + + ++ + + ++ Firebase Console : Create Project https://console.firebase.google.com
  • 6. + + ++ + + ++ Facebook Developer : Create Project https://developers.facebook.com
  • 7. + + ++ Firebase Console : Enable Auth https://console.firebase.google.com/
  • 8. + + ++ + + ++ 1. Create a Firebase project in the Firebase console, if you don't already have one. If you already have an existing Google project associated with your mobile app, click Import Google Project. Otherwise, click Create New Project. 2. Click Add Firebase to your Android app and follow the setup steps. If you're importing an existing Google project, this may happen automatically and you can just download the config file. 3. When prompted, enter your app's package name. It's important to enter the package name your app is using; this can only be set when you add an app to your Firebase project. 4. At the end, you'll download a google-services.json file. You can download this file again at any time. 5. If you haven't done so already, copy this into your project's module folder, typically app/. Integrate Firebase into your App https://firebase.google.com/docs/android/setup
  • 9. + + ++ + + ++ ● Add rules to your root-level build.gradle file, to include the google-services plugin ● Then, in your module Gradle file (usually the app/build.gradle), add the apply plugin line at the bottom of the file to enable the Gradle plugin Add Firebase SDK
  • 10. + + ++ + + ++ ● Declare the FirebaseAuth and AuthStateListener objects. ● Initialize the FirebaseAuth instance and the AuthStateListener method so you can track whenever the user signs in or out. Integrate Firebase Auth https://firebase.google.com/docs/auth/android/start/
  • 11. + + ++ + + ++ ● Attach the listener to your FirebaseAuth instance in the onStart() method and remove it on onStop(). You can also add the listener in onAttach() method & remove it on onDetach() if you’re using Fragment Integrate Firebase Auth (2) https://firebase.google.com/docs/auth/android/start/
  • 12. + + ++ + + ++ ● Create a new account by passing the new user's email address and password to createUserWithEmailAndPassword If the new account was created, the user is also signed in, and the AuthStateListener runs the onAuthStateChanged callback. In the callback, you can use the getCurrentUser method to get the user's account data. Registering a User https://firebase.google.com/docs/auth/android/password-auth
  • 13. + + ++ + + ++ ● When a user signs in to your app, pass the user's email address and password to signInWithEmailAndPassword If sign-in succeeded, the AuthStateListener runs the onAuthStateChanged callback. In the callback, you can use the getCurrentUser method to get the user's account data. Logging In a User https://firebase.google.com/docs/auth/android/password-auth
  • 14. + + ++ + + ++ ● When a user signs in to your app, pass the user's email address to sendPasswordReset If password reset succeeded, Firebase will send an email to your account for a password reset steps. Forgot Password
  • 15. + + ++ Integrate Facebook Login to your App Facebook Login
  • 16. + + ++ + + ++ 1. Add mavenCentral() to your Module-level /app/build.gradle before dependencies 2. Add the compile dependency with the latest version of the Facebook SDK in the build.gradle file compile 'com.facebook.android:facebook-android-sdk:4.+' 3. Build your project. Import com.facebook.FacebookSdk into your app. 4. Initialize Facebook SDK before you can use it. Add a call to FacebookSdk.sdkInitialize from onCreate in your Application class FacebookSdk.sdkInitialize(getApplicationContext()); AppEventsLogger.activateApp(this); 5. add your Facebook App ID to your project's strings file and update your Android manifest 6. Add a meta-data element to the application element <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/> Integrate Facebook SDK into your App https://developers.facebook.com/docs/android/getting-started
  • 17. + + ++ + + ++ Set your Native Platform data Configure your Facebook App https://developers.facebook.com/docs/android/getting-started
  • 18. + + ++ + + ++ On OSX keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 On Windows keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%.androiddebug.keystore | openssl sha1 -binary | openssl base64 On Android Studio : Getting your Key Hash Value https://developers.facebook.com/docs/android/getting-started
  • 19. + + ++ + + ++ Configure your Facebook Login Parameter Configure your Facebook App https://developers.facebook.com/docs/android/getting-started
  • 20. + + ++ + + ++ ● Create CallbackManager Instance ● Register CallbackManager onActivityResult() Using Facebook Login Button https://developers.facebook.com/docs/facebook-login/android/v2.2
  • 21. + + ++ + + ++ ● Add Facebook Login Button to your XML File ● Customize the properties of Login button and register CallbackManager Using Facebook Login Button (2) https://developers.facebook.com/docs/facebook-login/android/v2.2
  • 22. + + ++ + + ++ ● After a user successfully signs in, in the LoginButton's onSuccess callback method, get an access token for the signed-in user, exchange it for a Firebase credential, and authenticate with Firebase using the Firebase credential Integrate Facebook Login with Firebase https://firebase.google.com/docs/auth/android/facebook-login
  • 23. + + ++ Clone Sample Project at : https://github.com/aqidd/firebase-auth-sample
  • 24. + + ++ Clone Complete Project at : https://github.com/aqidd/firebase-auth-sample/tree/develop
  • 25. Thank you. Let’s talk! www.flipbox.co.id 021 739 6426 • 0818 0725 2399 contact@flipbox.co.id + + ++