liveBook · Manning

Resource server

As explained in Software Security for Developers

A resource server is an application backend that hosts protected data and enforces authorization for requests bearing access tokens.

A resource server is an application backend that hosts data, handles business logic, and enforces authorization on requests carrying access tokens. It trusts an identity provider (IdP) to authenticate users or clients, then applies the appropriate restrictions to backend resources. section 12.2 section 12.5

A resource server participates in OAuth 2 and OpenID Connect alongside:

  • A user, who requests protected data or actions. section 12.2
  • A client, such as a browser application, mobile application, or service, which sends requests to the backend. section 12.2
  • An IdP or authorization server, which authenticates users or clients and issues tokens. section 12.5
  • The resource server, which receives requests, validates their tokens, and authorizes access to resources. section 12.2 section 12.5

In the authorization code flow, a client obtains an access token after the user authenticates, then presents that token to the resource server. A signed token can be checked cryptographically with a public key obtained from the IdP; an unsigned or opaque token requires token introspection, in which the backend asks the IdP whether the token remains valid. section 12.2.1 section 12.5

A protected shopping list

Jeanny asks a client to display her shopping list. After authentication, the client receives an authorization code, exchanges it for an access token, and uses the token to request the list from the resource server. The backend then responds according to the authorization represented by the request. section 12.2.1

Service-to-service access

A payment service can act as a resource server when an ACME service authenticates directly with an IdP through the client credentials grant, receives an access token, and sends authorized payment requests without user involvement. section 12.2.3

Figure 12.7 Verifying the authenticity of a signed token. When the resource server receives a signed token, it uses a public key to validate the token. The resource server obtains this public key from the IdP, allowing it to verify that the token is valid.
figure

Use the token-validation diagram to follow how a resource server obtains an IdP public key and verifies a signed token. section 12.2.1

How Software Security for Developers covers it

How deep it goes
Explains actors, authorization-code and client-credentials flows, token validation, and introspection without detailing backend implementation.
Examples
Uses a shopping-list request, ACME payment calls, signed-token verification, and opaque-token introspection as concrete examples.
What it assumes
Assumes basic application and authentication concepts while defining OAuth2 actors, access tokens, and token introspection.
What you can do after
Evaluate how a backend receives, validates, and authorizes OAuth2 access-token requests from users, applications, or services.
How it connects
Connects OAuth 2, OpenID Connect, identity providers, clients, access tokens, JWTs, and token introspection.

Also explained in

Compare how 4 books explain resource server →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Software Security for Developers. The section links point to the parts of the book it draws on.