liveBook · Manning

Chapter 14: Implementing an OAuth 2 authorization server

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

Introduces the authorization server’s role in OAuth 2 and identifies Spring Security’s current approach to implementing one.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces the authorization server’s role in OAuth 2 and identifies Spring Security’s current approach to implementing one.

Key terms: authorization server, client, tokens, Spring Security authorization server, OAuth 2/OpenID Connect authorization server

14.1 Implementing basic authentication using JSON web tokens

This section explains the components and basic configuration of a Spring Security OAuth 2 authorization server that issues non-opaque tokens.

Key terms: SecurityFilterChain, @Order, applyDefaultSecurity(), oidc(), UserDetailsService, PasswordEncoder, NoOpPasswordEncoder, BCrypt, RegisteredClient, RegisteredClientRepository

14.2 Running the authorization code grant type

This section tests the authorization server by discovering its endpoints, obtaining an authorization code through browser login, and exchanging that code for tokens using PKCE.

Key terms: OpenID configuration endpoint, defaults, authorization endpoint, response_type=code, client_id, scope, redirect_uri, authorization code, token endpoint, HTTP Basic

14.3 Running the client credentials grant type

This section shows how a registered client obtains an access token with the client credentials grant type and why its registration and scope should be distinct from user-dependent grants.

Key terms: client credentials grant type, access token, client ID and secret, HTTP Basic, scope, registered client, authorization code grant type

14.4 Using opaque tokens and introspection

This section shows that registered clients can receive opaque access tokens and explains how introspection checks those tokens, including how expiration affects the result.

Key terms: opaque tokens, registered clients, JWT, client credentials grant type, introspection, introspection endpoint, HTTP Basic, active, active time, time to live

14.5 Revoking tokens

This section explains how to revoke an issued token and why relying on revocation adds a validation cost.

Key terms: token revocation, token revocation endpoint, HTTP Basic authentication, introspection endpoint, revocation feature, introspection, non-opaque tokens, performance

14.6 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 13: What are OAuth 2 and OpenID Connect? Chapter 15: Implementing an OAuth 2 resource server →

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.