11 OAuth 2

This chapter covers

  • Registering an OAuth client
  • Requesting authorization to protected resources
  • Granting authorization without exposing authentication credentials
  • Accessing protected resources

OAuth 2 is an industry standard authorization protocol defined by the IETF. This protocol, which I refer to as just OAuth, enables users to authorize third-party access to protected resources. Most importantly, it allows users do this without exposing their authentication credentials to third parties. In this chapter, I explain the OAuth protocol, walking through it with Alice, Bob, and Charlie. Eve and Mallory both make an appearance as well. I also show you how to implement this protocol with two great tools, Django OAuth Toolkit and

Get Full Stack Python Security now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.