Code Monkey home page Code Monkey logo

firebase-google-phone-signin's Introduction

firebase-google-phone-signin

Authentication using Google and Phone Number/OTP using firebase for web

We can Signin via Google and Phone Number/OTP using firebase easily. In this repository I will show how to do that.

This repository contains 3 files:

  1. index.html : The HTML web page that is to be hosted.
  2. app.js : The javascript Code in order to provide signin and signout functionalities to our web page and provide authentication via Google and OTP to web page.
  3. style.css : For basic styling of UI.

First we need to install firebase on our system. This is how to do it in Ubuntu/Linux: Steps:

  1. you can use sudo apt-get install nodejs but it installs and older version of nodejs so it is better to go for the following commands: Get latest version of nodejs: a) sudo apt-get install curl python-software-properties b) curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - c) sudo apt-get install -y nodejs d) sudo apt-get update && sudo apt-get -y upgrade

After these commands, check for successful installations of node and npm by the following commands: a) node -v b) npm -v

  1. Install firebase locally: sudo npm install -g firebase-tools

  2. Login to Firebase, login page will open in browser: firebase login

  3. Next open firebase in browser at their website, open firebase console and create your own project.

  4. After creation go to authentication tab and enable the signin options you want to use, in my case Google and Phone Auhentication.

  5. git clone this repository and put it in the public folder on your system.

  6. Select: Add firebase to your project web and copy-paste the credentials you get in the index.html at the starting of your code.

  7. Next go to the public folder in your system, and copy and paste the 3 files in the repo in the public folder. Open terminal.

  8. Initialise Firebase and select the option you want to go for: firebase init

  9. Select hosting and press spacebar, press enter at the questions you get, and in the question where it asks to overwrite index.html, answer No.

  10. Next deploy it on the URL: firebase deploy

firebase-google-phone-signin's People

Contributors

singh-shreya6 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.