liveBook · Manning

Chapter 15: Implementing an OAuth 2 resource server

What you will learn in chapter 15 of Spring Security in Action, Second Edition

The introduction identifies the OAuth 2 resource server as the backend that uses tokens from an authorization server and explains why its security must be implemented even when the authorization server is provided by a third party.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The introduction identifies the OAuth 2 resource server as the backend that uses tokens from an authorization server and explains why its security must be implemented even when the authorization server is provided by a third party.

Key terms: resource server, authorization server, token, authentication, authorization, backend

15.1 Configuring JWT validation

This section configures a Spring Security resource server to validate JWT access tokens and tests a protected endpoint with a token from an authorization server.

Key terms: JWTs, non-opaque tokens, authorization server, well-known configuration endpoint, public key set URI, access token’s signature, resource server starter, SecurityFilterChain, oauth2ResourceServer(), jwt()

15.2 Using customized JWTs

The section shows how to add a custom priority claim to a JWT and make its value available in a resource server’s authentication object.

Key terms: custom claim, priority, OAuth2TokenCustomizer, access token, JwtAuthenticationToken, CustomAuthentication, Converter, Jwt, authorities, jwtAuthenticationConverter()

15.3 Configuring token validation through introspection

This section shows how to configure and test an OAuth 2 resource server that validates access tokens through introspection.

Key terms: opaque tokens, introspection, token revocation, resource server, client credentials, RegisteredClientRepository, introspection endpoint, introspection URI, client ID, client secret

15.4 Implementing multitenant systems

This section explains how a resource server selects authentication logic when it must work with multiple authorization servers or nonstandard integrations.

Key terms: filter, authentication manager, authentication provider, authentication manager resolver, JwtIssuerAuthenticationManagerResolver, authenticationManagerResolver(), authorization servers, JWTs, type header, JwtAuthenticationProvider

15.5 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 14: Implementing an OAuth 2 authorization server Chapter 16: Implementing an OAuth 2 client →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.