Course contentsShow
← Computer Science
Lesson 2534 of 2,87256. Authentication and AuthorizationFree lesson

OAuth 2.0 Overview and Use Cases

Understand OAuth 2.0 as a delegation protocol, enabling third-party apps to access resources without sharing credentials.

OAuth 2.0 Overview and Use Cases

You'll learn: How OAuth 2.0 enables secure, credential-free delegation of access between applications.

What Is OAuth 2.0?

OAuth 2.0 is a delegation protocol, not an authentication protocol. It allows you to grant third-party applications limited access to your resources without sharing your actual username and password. Think of it like giving a valet key to a parking attendant—it opens your car doors and starts the engine, but won't open the trunk or glove box.

How OAuth 2.0 Solves a Real Problem

Imagine you want a photo-printing app to access your photos stored in your cloud storage account. The bad approach: give the printing app your cloud storage password. Now they can access everything, change your password, or store it insecurely.

OAuth 2.0's approach: the printing app redirects you to your cloud storage provider, where you log in directly and grant the printing app specific, limited access (like "read photos only"). The cloud provider issues the printing app a token that represents this permission. No passwords shared!

Common Use Cases

  • Social login ("Sign in with Google/Facebook") - apps obtain your profile info without your password
  • API integrations - calendar apps accessing your email to auto-add events
  • Mobile apps - fitness trackers syncing data to health platforms
  • Service-to-service - one backend system accessing another's API resources

The Four OAuth Roles

  1. Resource Owner (you, the user)
  2. Client (the third-party app requesting access)
  3. Authorization Server (issues tokens after consent)
  4. Resource Server (holds your protected data)

Key Takeaway: OAuth 2.0 enables secure delegation by issuing limited-scope access tokens to third-party applications, eliminating password sharing while maintaining user control over permissions.