Skip to content

Commit 1b5f59b

Browse files
Implement ServerHttpSecurity Oauth2ResourceServerSpecTests for ServerAuthenticationSuccessHandler in the proper class and update ServerHttpSecurity to set the success handler for JWT and Opaque tokens.
1 parent 475fae7 commit 1b5f59b

File tree

3 files changed

+180
-205
lines changed

3 files changed

+180
-205
lines changed

config/src/main/java/org/springframework/security/config/web/server/ServerHttpSecurity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4412,6 +4412,7 @@ protected void configure(ServerHttpSecurity http) {
44124412
AuthenticationWebFilter oauth2 = new AuthenticationWebFilter(authenticationManager);
44134413
oauth2.setServerAuthenticationConverter(OAuth2ResourceServerSpec.this.bearerTokenConverter);
44144414
oauth2.setAuthenticationFailureHandler(authenticationFailureHandler());
4415+
oauth2.setAuthenticationSuccessHandler(authenticationSuccessHandler());
44154416
http.addFilterAt(oauth2, SecurityWebFiltersOrder.AUTHENTICATION);
44164417
}
44174418

@@ -4544,6 +4545,7 @@ protected void configure(ServerHttpSecurity http) {
45444545
AuthenticationWebFilter oauth2 = new AuthenticationWebFilter(authenticationManager);
45454546
oauth2.setServerAuthenticationConverter(OAuth2ResourceServerSpec.this.bearerTokenConverter);
45464547
oauth2.setAuthenticationFailureHandler(authenticationFailureHandler());
4548+
oauth2.setAuthenticationSuccessHandler(authenticationSuccessHandler());
45474549
http.addFilterAt(oauth2, SecurityWebFiltersOrder.AUTHENTICATION);
45484550
}
45494551

config/src/test/java/org/springframework/security/config/annotation/web/reactive/ReactiveOauth2ResourceServerTests.java

Lines changed: 0 additions & 205 deletions
This file was deleted.

0 commit comments

Comments
 (0)