liveBook · Manning

OAuth

As explained in ASP.NET Core in Action, 3e

OAuth 2.0 is an authorization protocol that lets a resource owner delegate controlled access to protected resources without revealing credentials to the accessing service.

OAuth 2.0 is an authorization protocol for delegating controlled access to a protected resource without revealing the resource owner's credentials or other private details. section 25.1.3

The protocol separates access delegation from identity management. OpenID Connect builds on OAuth 2.0 to add authentication, conventions, discoverability, and identity information. section 25.1.3 section 25.7

A typical interactive authorization flow proceeds as follows:

  • The application redirects the user to an identity provider. section 25.1.3
  • The user signs in and approves the requested access, such as access to photos. section 25.1.3
  • The provider redirects back with an authorization code, which the application uses with its client secret to obtain access. section 25.1.3

Printing dog photos

A user asks dogphotos.com to print photos stored on Facebook. Instead of giving dogphotos.com Facebook credentials, the user signs in at Facebook, approves access to photos, and lets dogphotos.com receive delegated access. section 25.1.3

Figure 25.5 Using OAuth 2.0 to authorize dogphotos.com to access your photos on Facebook
CH25_F05_Lock3

Follow the authorization-code sequence from the application redirect through user consent and the provider callback. section 25.1.3

OAuth 2.0 defines multiple grant types. Authorization code with PKCE is the common interactive choice, while client credentials suits machine-to-machine API calls. section 25.7

How ASP.NET Core in Action, 3e covers it

How deep it goes
Explains the authorization-code sequence and grant-type choices, but stops short of protocol internals or implementation code.
Examples
Uses dogphotos.com accessing Facebook photos through redirects, consent, an authorization code, and delegated access.
What it assumes
Builds from a basic distinction between authentication and authorization, introducing identity providers before OpenID Connect details.
What you can do after
Evaluate authorization flows and choose interactive or machine-to-machine grants for API access scenarios.
How it connects
Connects authorization codes, PKCE, client credentials, OpenID Connect, identity providers, protected resources, and bearer tokens.

Also explained in

Compare how 9 books explain OAuth →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ASP.NET Core in Action, 3e. The section links point to the parts of the book it draws on.