Firebase: Google Sign-In AuthenticationAs we have discussed earlier, Firebase provides different types of Authentication methods. In our previous section, we learned how authentication is done using Firebase UI and Firebase SDK. In this section, we will learn another method, i.e., Google Sign-in Authentication. It is pretty easy to do. Starting steps are the same as we have done with other authentication methods, which are as follows:
Step 1: Apart from firebase auth and core libraries, we have to add google play services auth in app.gradle file Step 2: In the next step, we have to enable the Google sign-in method in Firebase console. We also have to add a project supporting email. Step 3: Just like our previous method, we have to set SHA-1 and SHA-256 keys. Step 4: In the next step, we will create the layout file that contains three buttons Google sign-in, sign-out, and sign-out and disconnect. The activity layout will look like: Step 5: Now, we will modify our MainActivity.java file to perform the Google sign-in authentication in the following way:
Next TopicFacebook Sign-In Authentication
|