Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Firebase Authentication and Android

Firebase Authentication and Android

RuslanKuziak

January 24, 2018
Tweet

Other Decks in Programming

Transcript

  1. What is Firebase Auth? • Firebase Authentication - 1/3 core

    services (realtime database, auth, hosting) of Firebase, Inc. platform • Provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app* • Supports authentication using passwords, phone numbers, popular federated identity providers like Google, Facebook and Twitter, and more* * taken from https://firebase.google.com/docs/auth
  2. Main features • Multiple Providers (Google Sign-In, Facebook, Twitter etc.)

    • Account Management (account creation, email verification and password reset) • Account Linking • Custom themes (next slides)
  3. Sign-in providers (1) • Requires configuring of the project manually

    • Facebook (https://developers.facebook.com) • Twitter (https://dev.twitter.com) • GitHub (https://github.com/settings/applications/new)
  4. Sign-in providers (2) • Firebase console does all configuration by

    her own • Google Sign-In • Email/Password • Phone • Anonymous
  5. • Using the Firebase UI Auth • Using the Firebase

    Authentication SDK Two ways of implementation • We will consider the first way - Firebase UI Auth
  6. Dependencies • implementation ‘com.firebaseui:firebase-ui-auth:3.1.0’* • implementation ‘com.google.firebase:firebase-auth:11.8.0’ * the first

    one contains "firebase-auth" as it’s dependency. There is no need to add both of them into app’s build.gradle file.
  7. Dependencies (Off topic) Starting from google play service's version below:

    implementation ‘com.google.android.gms:play-services-needed-service:9.4.0’* Where needed-service can be: "gcm", "location", “maps”, "ads" etc., play services implicitly includes firebase.
  8. Usage of Firebase Auth-UI SDK (1) | | • Starting

    of activity for Google Sign-In result
  9. Usage of Firebase Auth-UI SDK (2) • Starting of activity

    for email/password result • Starting of activity for Facebook result
  10. Sign in result • When the sign-in flow is complete

    onActivityResult() will be called
  11. FirebaseUser • To get FirebaseUser from any place of your

    app just call: • You will get their account data in case user successfully signed in or null otherwise.
  12. Using of Firebase Auth UI approach for the programmer seems

    quite easy BUT • What about UI? How it looks like for the user? Is it easy- customizable? spoiler: It isn’t!
  13. What Firebase doc says about customization of UI? • And

    it’s phenomenally! • Custom Themes - customize the look of FirebaseUI to match your app. Also, because FirebaseUI is open source, you can fork the project and customize it exactly to your needs.
  14. References • R&D Project - https://github.com/RuslanKuziak/r-and-d- project • https://firebase.google.com/docs/auth •

    https://firebase.google.com/docs/auth/android/ firebaseui • https://firebase.google.com/docs/auth/android/ manage-users