OAuth
Definition
Open Authorization. An open standard for access delegation, commonly used as a way for internet users to grant websites or applications access to their information on other websites but without giving them the passwords.
Explain Like I'm New
Logging in with the 'Sign in with Google' button. You don't give your app your Google password. Instead, you are redirected to Google. Google asks: 'Do you want to let this app see your email?'. You click Yes. Google redirects you back to the app with a secure temporary token. The app uses that token to prove to Google that you approved the access.
Real World Example
Using `Passport.js` in Node with the `passport-google-oauth20` strategy to allow users to bypass creating a new account and just sign in with their existing Google or GitHub accounts.
Common Use Cases
- •Social logins (Google, GitHub, Facebook)
- •Granting 3rd party apps access to APIs (like a budgeting app connecting to your bank)
Terminal Output
Interview Questions
basic
- Does OAuth share the user's password with the third-party app?
intermediate
- What is an OAuth Access Token?