-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Closed
Labels
in: coreAn issue in spring-security-coreAn issue in spring-security-coretype: enhancementA general enhancementA general enhancement
Milestone
Description
oauth2ResourceServer() introduces a couple of authenticationManager() methods for complete control over the authentication mechanism:
http
.oauth2ResourceServer()
.jwt()
.authenticationManager(...)This can be leveraged to construct a custom JwtAuthenticationProvider:
AuthenticationProvider jwt = new JwtAuthenticationProvider(... ;
http
.oauth2ResourceServer()
.jwt()
.authenticationManager(jwt::authenticate)However, the method reference shortcut may seem a bit terse for some tastes.
As an alternative, code can construct an instance of ProviderManager:
AuthenticationProvider jwt = new JwtAuthenticationProvider(... ;
http
.oauth2ResourceServer()
.jwt()
.authenticationManager(new ProviderManager(Arrays.asList(jwt)))This could be improved by adding a varargs constructor to ProviderManager:
AuthenticationProvider jwt = new JwtAuthenticationProvider(... ;
http
.oauth2ResourceServer()
.jwt()
.authenticationManager(new ProviderManager(jwt))Metadata
Metadata
Assignees
Labels
in: coreAn issue in spring-security-coreAn issue in spring-security-coretype: enhancementA general enhancementA general enhancement