Mastering Firebase for Android Development
上QQ阅读APP看书,第一时间看更新

FirebaseUI Auth authentication

There are two approaches we can choose to integrate Firebase Authentication into your project. The prominent one is with the Firebase SDK and the recommended one is to use the FirebaseUI Auth. By covering most of the use cases in FirebaseUI, the developer community voted to use the FirebaseUI library for many reasons:

  • The FirebaseUI Auth follows best practices for authentication on mobile devices and websites
  • Customizing the UI is very easy
  • It also knows how to handle cases such as account recovery and account linking, which can be delicate in terms of security and difficult to handle correctly.

Firebase UI offers all the necessary setup to integrate user authentication, which includes screens such as account creation and sign-in screens. It is also very easy to integrate the FirebaseUI auth, considering the following sequence of steps while using FirebaseUI Auth:

  1.  Identify the auth provider you will be using in your project (Google, Facebook, Twitter, GitHub and so on).
  2. Enable the appropriate provider in the Firebase console.
  3. Register the application in the provider's console and obtain a token.
  4. FirebaseAuth reference or add the dependency in your project.
  5. Use the AuthUI class to configure and build the FirebaseUI Authentication intent.