Răsfoiți Sursa

serverAuthenticationSuccessHandler->authenticationSuccessHandler

Issue: gh-4822
Rob Winch 8 ani în urmă
părinte
comite
520e0a5a68

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

@@ -543,17 +543,17 @@ public class ServerHttpSecurity {
 
 		private ServerAuthenticationFailureHandler authenticationFailureHandler;
 
-		private ServerAuthenticationSuccessHandler serverAuthenticationSuccessHandler = this.defaultSuccessHandler;
+		private ServerAuthenticationSuccessHandler authenticationSuccessHandler = this.defaultSuccessHandler;
 
 		public FormLoginSpec authenticationManager(ReactiveAuthenticationManager authenticationManager) {
 			this.authenticationManager = authenticationManager;
 			return this;
 		}
 
-		public FormLoginSpec serverAuthenticationSuccessHandler(
-			ServerAuthenticationSuccessHandler serverAuthenticationSuccessHandler) {
-			Assert.notNull(serverAuthenticationSuccessHandler, "serverAuthenticationSuccessHandler cannot be null");
-			this.serverAuthenticationSuccessHandler = serverAuthenticationSuccessHandler;
+		public FormLoginSpec authenticationSuccessHandler(
+			ServerAuthenticationSuccessHandler authenticationSuccessHandler) {
+			Assert.notNull(authenticationSuccessHandler, "authenticationSuccessHandler cannot be null");
+			this.authenticationSuccessHandler = authenticationSuccessHandler;
 			return this;
 		}
 
@@ -614,7 +614,7 @@ public class ServerHttpSecurity {
 			authenticationFilter.setRequiresAuthenticationMatcher(this.requiresAuthenticationMatcher);
 			authenticationFilter.setAuthenticationFailureHandler(this.authenticationFailureHandler);
 			authenticationFilter.setAuthenticationConverter(new ServerFormLoginAuthenticationConverter());
-			authenticationFilter.setServerAuthenticationSuccessHandler(this.serverAuthenticationSuccessHandler);
+			authenticationFilter.setAuthenticationSuccessHandler(this.authenticationSuccessHandler);
 			authenticationFilter.setSecurityContextRepository(this.securityContextRepository);
 			http.addFilterAt(authenticationFilter, SecurityWebFiltersOrder.FORM_LOGIN);
 		}

+ 1 - 1
config/src/test/java/org/springframework/security/config/web/server/FormLoginTests.java

@@ -124,7 +124,7 @@ public class FormLoginTests {
 				.anyExchange().authenticated()
 				.and()
 			.formLogin()
-				.serverAuthenticationSuccessHandler(new RedirectServerAuthenticationSuccessHandler("/custom"))
+				.authenticationSuccessHandler(new RedirectServerAuthenticationSuccessHandler("/custom"))
 				.and()
 			.build();
 

+ 4 - 4
web/src/main/java/org/springframework/security/web/server/authentication/AuthenticationWebFilter.java

@@ -43,7 +43,7 @@ public class AuthenticationWebFilter implements WebFilter {
 
 	private final ReactiveAuthenticationManager authenticationManager;
 
-	private ServerAuthenticationSuccessHandler serverAuthenticationSuccessHandler = new WebFilterChainServerAuthenticationSuccessHandler();
+	private ServerAuthenticationSuccessHandler authenticationSuccessHandler = new WebFilterChainServerAuthenticationSuccessHandler();
 
 	private Function<ServerWebExchange,Mono<Authentication>> authenticationConverter = new ServerHttpBasicAuthenticationConverter();
 
@@ -81,7 +81,7 @@ public class AuthenticationWebFilter implements WebFilter {
 		SecurityContextImpl securityContext = new SecurityContextImpl();
 		securityContext.setAuthentication(authentication);
 		return this.securityContextRepository.save(exchange, securityContext)
-			.then(this.serverAuthenticationSuccessHandler
+			.then(this.authenticationSuccessHandler
 				.onAuthenticationSuccess(webFilterExchange, authentication));
 	}
 
@@ -91,8 +91,8 @@ public class AuthenticationWebFilter implements WebFilter {
 		this.securityContextRepository = securityContextRepository;
 	}
 
-	public void setServerAuthenticationSuccessHandler(ServerAuthenticationSuccessHandler serverAuthenticationSuccessHandler) {
-		this.serverAuthenticationSuccessHandler = serverAuthenticationSuccessHandler;
+	public void setAuthenticationSuccessHandler(ServerAuthenticationSuccessHandler authenticationSuccessHandler) {
+		this.authenticationSuccessHandler = authenticationSuccessHandler;
 	}
 
 	public void setAuthenticationConverter(Function<ServerWebExchange,Mono<Authentication>> authenticationConverter) {

+ 1 - 1
web/src/test/java/org/springframework/security/web/server/authentication/AuthenticationWebFilterTests.java

@@ -69,7 +69,7 @@ public class AuthenticationWebFilterTests {
 	@Before
 	public void setup() {
 		this.filter = new AuthenticationWebFilter(this.authenticationManager);
-		this.filter.setServerAuthenticationSuccessHandler(this.successHandler);
+		this.filter.setAuthenticationSuccessHandler(this.successHandler);
 		this.filter.setAuthenticationConverter(this.authenticationConverter);
 		this.filter.setSecurityContextRepository(this.securityContextRepository);
 		this.filter.setAuthenticationFailureHandler(this.failureHandler);