Firebase Authentication in Twitter using Javascript

Welcome Folks I am back with another post. In this post we will be implementing Firebase Authentication in Twitter using Javascript. Just Follow the steps given below to make this application


Before you Begin


Sign in to Firebase


Create a Firebase Project


Before you add Firebase to your application you need to create a firebase project in the firebase console



Click Add App button and select web appplication



Give a suitable name to your app as shown below




After that add Firebase SDK to the app by copy paste the following code. This code is auto generated and is different for each project.



After you have created Firebase Project you need to make a Twitter Project by going to their developers website


Create Twitter Project


You can go to Twitter Developer Website to signup and create project as shown below









You need to copy paste the same api key and api secret key in the firebase console of your project also something like this as shown below



Also copy paste the same callback url which is shown in the firebase console into twitter project callback url just follow the step shown below and open twitter project and paste same callback url like this shown below



After doing all these steps you are set to go for actually coding this application. So just your favourite ide and create a html file and copy paste the following code into it as shown below.



In these lines of code we are just setting div sections for holding twitter profile pic and display name for the user respectively



This is the business logic of the application. This script contains only function that is sign in which will be executed whenever the user presses the sign in button in the web page so in this function first of all whenever user presses button a twitter popup window will appear asking the user to grant access to the application something as shown below. The user needs to grant access to the application so that we can fetch user display name and profile pic of user twitter account





Sign out a User in Firebase Twitter


Leave a Reply