Chapter 11. OAuth tokens

 

This chapter covers

  • What an OAuth token is
  • Including information in structured JSON Web Tokens (JWT)
  • Protecting token data with JOSE
  • Looking up token information in real time with token introspection
  • Managing a token lifecycle with token revocation

For all its redirects and flows and components, the OAuth protocol is ultimately about tokens. Think back to our cloud-printing example from chapter 1. In order for the photo-storage service to know that the printer had access to the photos, the printer service needed to give something to prove that authorization. We call the thing that the printer gives to the storage service an access token, and we’ve already been working with them extensively throughout the book. Now we’re going to take a more in-depth look at OAuth tokens and managing them in an OAuth ecosystem.

11.1. What are OAuth tokens?

Tokens are at the core of all OAuth transactions. Clients fetch tokens from the authorization server to give to the protected resource. The authorization server creates tokens and hands them out to clients, managing resource owner delegations and client permissions to attach to the tokens along the way. The protected resource receives tokens from the clients and validates them, matching the attached permissions and rights to the request made by the client.

11.2. Structured tokens: JSON Web Token (JWT)

11.3. Cryptographic protection of tokens: JSON Object Signing and Encryption (JOSE)

11.4. Looking up a token’s information online: token introspection

11.5. Managing the token lifecycle with token revocation

11.6. The OAuth token lifecycle

11.7. Summary

sitemap