liveBook · Manning

Authentication manager resolver

As explained in Spring Security in Action, Second Edition

authenticationManagerResolver() is a Spring Security configuration method that supplies an authentication manager resolver for resource-server authentication.

An authentication manager resolver lets a resource server choose which authentication manager should process each request. The selected manager can use a custom authentication provider, making the pattern useful for multitenancy and nonstandard authentication. section 15.4 section 15.5

Use the resolver when the resource server must:

  • Authenticate tokens from multiple authorization servers using JwtIssuerAuthenticationManagerResolver. section 15.4

Configure the resource server

Pass authenticationManagerResolver() to oauth2ResourceServer(). A resolver can return a JwtAuthenticationProvider-backed manager for JWTs or an OpaqueTokenAuthenticationProvider-backed manager for opaque tokens.

How Spring Security in Action, Second Edition covers it

How deep it goes
Explains delegation and provides Java configurations for multiple JWT issuers and mixed JWT or opaque tokens.
Examples
Uses two JWT authorization servers and a request-header switch between JWT and opaque-token authentication.
What it assumes
Assumes basic Spring Security authentication design and teaches customization through managers, providers, and resolvers.
What you can do after
Configure a Spring Security resource server to delegate authentication to managers selected dynamically from the request.
How it connects
Connects authentication managers, authentication providers, authorization servers, JWT, opaque tokens, and multitenancy.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring Security in Action, Second Edition. The section links point to the parts of the book it draws on.