Sitemap
Bhushan Trivedi

Bhushan Trivedi

Learning Enthusiast | Future Forward | Knowledge Sharing Guy

๐—›๐—ผ๐˜„ ๐——๐—ผ๐—ฒ๐˜€ ๐—ข๐—”๐˜‚๐˜๐—ต ๐Ÿฎ.๐Ÿฌ ๐—ช๐—ผ๐—ฟ๐—ธ?

2 min readFeb 6, 2024
Press enter or click to view image in full size
OAuth 2.0

๐—ข๐—”๐˜‚๐˜๐—ต ๐Ÿฎ.๐Ÿฌ is a widely used protocol that allows secure access between different online services without sharing sensitive user credentials like passwords.

Hereโ€™s a simplified breakdown of how it works:

Imagine you want to log in to a website using your existing Facebook account:

  1. Initiation: The website (client) directs you to Facebook (authorization server) for permission to access your data.
  2. Authorization: Facebook prompts you to confirm if you want to grant the website access to specific information (photos, email, etc.). If you agree, Facebook generates a temporary code (authorization code).
  3. Redirection: Facebook redirects you back to the website, along with the authorization code.
  4. Token Exchange: The website sends the authorization code and its secret key back to Facebook.
  5. Access Grant: If valid, Facebook verifies the code and grants an access token, which is like a secure key unlocking your data.
  6. Resource Access: The website uses the access token to request your information from Facebook securely, without needing your password.
  7. Limited Access: The access token has specific permissions and may expire, ensuring controlled access to your data.
Press enter or click to view image in full size
OAuth 2.0 Work Flow

In this process, the playerโ€™s Facebook credentials were never shared, but the game was able to access the agreed-upon player data from Facebook. This is what OAuth 2.0 facilitates; allowing third-party applications to access data from services in a secure manner without sharing credentials.

Benefits of OAuth 2.0:

  1. User Authorization Without Sharing Credentials: OAuth 2.0 allows users to grant limited access to their resources (e.g., data, services) to third-party applications without exposing their credentials (username and password). This enhances security and minimizes the risk of credential exposure.
  2. User Control: Users have granular control over what information they share with third-party applications, granting specific permissions instead of all-or-nothing access.
  3. Convenience: Users can sign in to websites and applications seamlessly using their existing accounts, improving user experience and reducing sign-up friction.
  4. Flexibility: OAuth 2.0 offers various authorization flows to cater to different types of applications and use cases, ensuring wider compatibility and adaptability.

Conclusion:

Get Bhushan Trivediโ€™s stories inย yourย inbox

Join Medium for free to get updates fromย thisย writer.

OAuth 2.0 has established itself as the go-to protocol for secure user authorization online. Its key benefits include:

Enhanced Security: Eliminating password sharing mitigates risks of credential compromise.

User Control: Granular permissions ensure users control what data is accessed by third-party applications.

Convenience: Seamless login experiences across different platforms and services.

Flexibility: Diverse authorization flows cater to various client types and use cases.

References: Postman

--

--

Bhushan Trivedi
Bhushan Trivedi

Written by Bhushan Trivedi

Learning Enthusiast | Future Forward | Knowledge Sharing Guy