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?

Updated on: 10 Jan 2022 by Ashish
Table of Contents
  • What is OAuth?
  • ​How does OAuth work?
  • Suggested Reading

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.


Recommended Video for you:

Google Maps Secrets: How Exactly Does Google Maps Work?

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.

​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.

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

Suggested Reading

  • The Shallows: What the Internet Is Doing to Our Brains
    Check on Amazon

  • Algorithms to Live By: The Computer Science of Human Decisions
    Check on Amazon

  • Artificial Intelligence: A Modern Approach, Global Edition
    Check on Amazon

References
  1. The official website (OAuth)
  2. Facebook login permissions
  3. Google login permissions
Was this article helpful?
YesNo
Help us make this article better
Tags: Computing, Google, Login, Password, User

Follow ScienceABC on Social Media:

  • Facebook
  • Twitter
  • Instagram
  • YouTube
  • LinkedIn
  • Pinterest
  • Odysee
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.
Related Posts
google and Facebook

How Does Facebook Know What You’ve Searched On Google?

June 9, 2019 Technology
close up hand blocks the covered webcam with a white sticker tape(Mike_shots)s

Why Should You Cover Your Webcam?

December 21, 2019 Technology
Face inside Laptop

How Much Of Your Personal Data Do Google And Facebook Have?

July 13, 2015 Humans
messenger collage

Why Don’t Emails Arrive Immediately Like Instant Messages?

August 21, 2018 Technology
Furious man angry about bad news online

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

December 22, 2020 Technology
Old vintage padlock and key on wooden texture with password sign(Martin M303)s

If Websites Don’t Store Your Password On Their Servers, How Are They Able To Tell You The Strength Of Your Password?

May 20, 2020 Technology
Science ABC YouTube Videos

  1. Black Holes Explained: What Is a Black Hole? How They Form?Black Holes Explained: What Is a Black Hole? How They Form?
  2. Gut Microbiome Explained in Simple WordsGut Microbiome Explained in Simple Words
  3. Particle accelerators: What are they, how do they work and why are they important to us?Particle accelerators: What are they, how do they work and why are they important to us?
  4. How Do Neurons Work?How Do Neurons Work?
  5. How Scientifically Accurate Is The HBO Miniseries Chernobyl?How Scientifically Accurate Is The HBO Miniseries Chernobyl?
  6. Cellular Respiration: How Do Cell Get Energy?Cellular Respiration: How Do Cell Get Energy?
  7. Multiverse Theory Explained: Does the Multiverse Really Exist? Truth of Multiple RealitiesMultiverse Theory Explained: Does the Multiverse Really Exist? Truth of Multiple Realities
  8. What Exactly is Spacetime? Explained in Ridiculously Simple WordsWhat Exactly is Spacetime? Explained in Ridiculously Simple Words

Popular Posts

  • Color of the Dress
    Blue-Black Or White-Gold? What Color Is The Damn Dress!
  • Phelps
    Scientific Analysis Of Michael Phelps’s Body Structure
  • Cigarette near gasoline
    Can A Cigarette Ignite A Puddle of Gasoline?
  • Life On Earth jungle safari elephant people water river green
    Should Elephants Carry Weight On Their Back?
  • Colonel
    Why Is ‘Colonel’ Pronounced ‘Kernel’?
  • Parachute wearing airplane passenger
    Why Don’t Commercial Airplanes Have Parachutes For All Their Passengers?
  • Feet in Bed
    Why Does Sleeping With Your Feet Outside the Covers Help You Sleep?
  • Happy couple taking a selfie together on the couch at home
    Why Do Our Faces Look So Weird In The TikTok Inverted Filter?
  • Light Pillars, West Virginia(Malachi Jacobs)s
    What Are Light Pillars? What Causes Light Pillars?
  • stomach and poop
    If The Stomach Adds Acid To Digest Food, Why Isn’t Our Poop Acidic?

Recent Posts

  • Close,Up,Portrait,Nurse,Worker,Hide,Face,Eyes,Look,Peeping
    Do Our Eyes Have A Separate Immune System?
  • Drawing,Of,Old,Man,Back,To,Back,With,Chimp,Monkey.
    Why Is It That Apes Can’t Speak But Humans Can?
  • standard_compressed_Wright
    How Did The Search For The Philosopher’s Stone Lead To The Discovery Of Phosphorus?
  • The Great Bear. Vector Illustration of Ursa Major. Digital background
    Are The Constellations Always Going To Look The Same As They Look Today?
  • BIG beetle
    Why Are Beetles Having Sex With Bottles?

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 © 2022.
  • Write for us!
  • About Us
  • Privacy Policy
  • Terms of Use
  • Contact Us