Science ABC

  • Physics
    • Astrophysics
    • Theoretical Physics
    • Sports
    • Super Heroes
    • Earth Science
  • Chemistry
  • Biology
    • Botany
    • Zoology
    • Medicine
    • Neuroscience
  • Engineering
    • Technology
    • Artificial Intelligence
    • Computing
  • Mathematics
  • Social Science
    • Psychology
    • History
    • Sociology
    • Geography
    • Philosophy
    • Economics
    • Linguistics
    • Art
  • Videos
  • About Us
  • Physics
    • Astrophysics
    • Theoretical Physics
    • Sports
    • Super Heroes
    • Earth Science
  • Chemistry
  • Biology
    • Botany
    • Zoology
    • Medicine
    • Neuroscience
  • Engineering
    • Technology
    • Artificial Intelligence
    • Computing
  • Mathematics
  • Social Science
    • Psychology
    • History
    • Sociology
    • Geography
    • Philosophy
    • Economics
    • Linguistics
    • Art
  • Videos
  • About Us
Home  »  Technology

OAuth: How Does ‘Login With Facebook/Google’ Work?

Written by AshishLast Updated On: 19 Oct 2023Published On: 15 Jun 2017
Table of Contents (click to expand)
  • What Is OAuth?
  • ​How Does OAuth Work?

OAuth is a protocol that allows third-party websites to access and retrieve select pieces of information from larger websites in order to authenticate users. This process is safe and secure, and helps to protect confidential information.

It is absolutely safe to log in on apps and third-party websites using your Facebook or Google account. Big tech companies (e.g., Google, Facebook etc.) use a standard called OAuth, which allows third-party websites to access and retrieve select pieces of information from these big websites in order to authenticate users.

Before we delve deeper into this technological mystery of logging in on websites, let’s take a quick look at the technological mechanism in question.


What Is OAuth?

OAuth is a protocol that helps ‘big’ websites (websites that have a very large number of users, such as Google, Facebook etc.) grant access to its users’ information to third-party websites or applications without sharing the users’ passwords and other private, sensitive details.

Oauth Logo
The official OAuth Logo (Photo Credit : Wikipedia Commons)

In more technical terms, OAuth is an open standard for secure access delegation, which means it is a service that allows web giants like Google or Microsoft to permit its users to share their own select pieces of information with third-party websites or applications, while protecting the confidential info of users at the same time.

social media collage
OAuth is generally used by websites or applications like Facebook, Google, Twitter and Microsoft, all of which have a humongous  user database.

A Hypothetical Situation Where OAuth Fits Perfectly

Suppose you want to make some quick edits to an image online. You go to a website, say, Canva, which helps you edit your image directly in your web browser window. However, there’s a catch; in order to use its services, Canva requires you to sign up.

Since the image only requires 5-6 minutes of quick editing, you might not feel like spending even more time filling out a sign-up form from scratch. Or you might just be too bored to fill out a form. I know plenty of people who frown at the mere sight of a sign-up page!

To be honest, I think it’s fairly reasonable to get upset. In the modern, fast-paced world, where the attention span of an Internet user is less than a minute, asking a user who intends to spend only a few minutes on your website to sign up and create an account from scratch is actually asking a lot! The user might just leave such a ‘demanding’ website and find another that doesn’t require them to sign up for anything.

How OAuth Saves You From Hassles Of Signing Up?

Most third-party websites (that require you to have an account) understand the reluctance of users to create new accounts. In a bid to ensure that they do not lose out on such ‘reluctant’ users, these third-party websites implement the OAuth standard in their system.

An OAuth-enabled third-party website (e.g., Canva) typically gives you 2 options: either sign up the ‘conventional way’, i.e., by filling out an online form, or sign up using Facebook or Google.

Website login with facebook
Notice the two methods of signing up on an application: one allows you to use your social media accounts, while the ‘conventional’ one uses your email.

Canva, like virtually all websites on the Internet, knows that Facebook and Google have a mammoth user base (i.e., the number of users of their services runs in the billions), and it bets on the fact that you might have an account on either/both of those websites (Google/Facebook).

Therefore, instead of asking a new user to fill out a sign-up form manually, which could potentially take 10 minutes or more, depending on the speed and ‘annoyance level’ of the user, Canva simply asks you to sign up using your Google/Facebook account.

Also Read: How Are Hackers Able To Figure Out Passwords When There Is A Maximum Limit Of Entering Incorrect Passwords?

​How Does OAuth Work?

This is basically how the OAuth standard works:

Suppose, you (the user) need to sign up/create an account on a third-party website/application (e.g., Canva).

First, you click on the “Sign up with Facebook’ button.

Canva login with facebook
Photo Credit ; Canva.com

It redirects you to Facebook.com and checks whether you are already logged in to Facebook. If you’re not, then it prompts you to enter your username and password to access your account. Once logged in, it shows you a small dialog box that describes the kind and extent of information that you’ll be sharing with the third-party website. If you are okay with sharing the required info with that third-party website, you press the ‘Continue’ button.

login with facebook
The info that Canva, a third-party website, wants to access through Facebook (Photo Credit : Facebook)

If you’re not okay with the info that’s going to be shared with the third-party website, you can always edit your preferences.

login with facebook
Photo Credit : Facebook

Now, Facebook redirects you to the concerned third-party website with an authentication code, which is basically Facebook’s way of telling the website that ‘yes, this person holds a valid account with me’.

The website now shows Facebook the unique code it acquired when it first registered itself with Facebook as a legitimate website/application. Facebook uses that code to verify the identity of the website, and in return, grants an access token to the website.

Third-party website You login with your credentials Login with Facebook redirects to third party website with authentication code TPW uses that Authentication code to get an Access token
(Photo Credit : Scienceabc.com)

It is this token that the website uses to gain restricted/limited access to some of your account information, usually consisting of your name, email address, gender and so on.

This is, in essence, how OAuth helps big websites like Google or Facebook grant limited access to users’ select pieces of information to third-party applications. To read more about the entire process, check out the official pages of Facebook and Google that discuss this system in great detail (links are provided in the references section).

In a nutshell, OAuth basically lets you give third-party websites a special key that opens only one door of your house and simultaneously protects the master key (i.e., the username and password of Google/Facebook), which can open all the doors of the house.

Also Read: How Can Your ISPs Track Your Online Activity?

How much do you know about OAuth?

Can you answer three questions based on the article you just read?

Question

Your answer:

Correct answer:

You got {{SCORE_CORRECT}} out of {{SCORE_TOTAL}}

SHARE YOUR RESULTS

ShareTweetPinEmail

Your Answers


References (click to expand)
  1. OAuth Community Site. OAuth
  2. Permissions Guide - Facebook Login - Meta for Developers. Facebook
  3. OpenID Connect | Authentication - Google Developers. Google LLC
Help us make this article better
Tags: Computing, Google, Login, Password, User
About the Author

Ashish is a Science graduate (Bachelor of Science) from Punjabi University (India). He spearheads the content and editorial wing of ScienceABC and manages its official Youtube channel. He’s a Harry Potter fan and tries, in vain, to use spells and charms (Accio! [insert object name]) in real life to get things done. He totally gets why JRR Tolkien would create, from scratch, a language spoken by elves, and tries to bring the same passion in everything he does. A big admirer of Richard Feynman and Nikola Tesla, he obsesses over how thoroughly science dictates every aspect of life… in this universe, at least.

More from this author.

Popular Posts

  • plant in space
    How Do Astronauts Grow Plants In Space?
  • Young man pointing a gun at his head sucide murder irritate
    Gunshot To The Head: Does It Always Mean Instant Death?
  • glowing-meteor-abstract-light-lines-technology-background-3d-illustration_t20_ZJJR3b
    What Are Bit Flips And How Are Spacecraft Protected From Them?
  • Navy Standard Missile-2 missiles on a missile launcher
    Would A Nuclear Missile Cause A Nuclear Explosion If It’s Shot In Mid-Air?
  • Young,Woman,Looking,On,The,Black,Board,With,Mathematical,Formulas
    Is Mathematics An Invention Or A Discovery?
  • sink or float
    Why Does Some Poop Float While Others Sink?
  • 5 parasite
    Can Parasites Control Your Mind?
  • cracked game
    How Are Computer Games ‘Cracked’?
  • How Do Bug Sprays (Like Raid and Baygon) Kill Cockroaches?
    How Do Bug Sprays (Like Raid And Baygon) Kill Cockroaches?
  • Earth burning
    What If Earth Had No Atmosphere?

Recent Posts

  • Why Does Coffee Powder Contain Chicory? And Is This Coffee Powder Instant Coffee Or Artisanal …
  • Why Were Christopher Columbus’ Voyages Backed By The Spanish Monarchy?
  • How Did The JWST Determine The Temperature Of An Exoplanet?
  • If Weak Force Is So Weak, Why Is It Needed At All?
  • Why Are Red Wine Glasses Wider Than White Wine Glasses? Chemistry!

ScienceABC participates in the Amazon Associates Program, affiliate advertising program designed to provide a means for sites to earn commissions by linking to Amazon. This means that whenever you buy a product on Amazon from a link on here, we get a small percentage of its price. That helps support ScienceABC with some money to maintain the site. Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.

Science ABC Copyright © 2025.
  • About Us
  • Publishing Policy
  • Privacy Policy
  • Terms of Use
  • Contact Us