|
@@ -69,7 +69,7 @@ public class FormLoginTests {
|
|
public void defaultLoginPage() {
|
|
public void defaultLoginPage() {
|
|
// @formatter:off
|
|
// @formatter:off
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
- .authorizeExchange((exchange) -> exchange
|
|
|
|
|
|
+ .authorizeExchange((authorize) -> authorize
|
|
.anyExchange().authenticated())
|
|
.anyExchange().authenticated())
|
|
.formLogin(withDefaults())
|
|
.formLogin(withDefaults())
|
|
.build();
|
|
.build();
|
|
@@ -100,7 +100,7 @@ public class FormLoginTests {
|
|
@Test
|
|
@Test
|
|
public void formLoginWhenDefaultsInLambdaThenCreatesDefaultLoginPage() {
|
|
public void formLoginWhenDefaultsInLambdaThenCreatesDefaultLoginPage() {
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
- .authorizeExchange((exchanges) -> exchanges.anyExchange().authenticated())
|
|
|
|
|
|
+ .authorizeExchange((authorize) -> authorize.anyExchange().authenticated())
|
|
.formLogin(withDefaults())
|
|
.formLogin(withDefaults())
|
|
.build();
|
|
.build();
|
|
WebTestClient webTestClient = WebTestClientBuilder.bindToWebFilters(securityWebFilter).build();
|
|
WebTestClient webTestClient = WebTestClientBuilder.bindToWebFilters(securityWebFilter).build();
|
|
@@ -127,7 +127,7 @@ public class FormLoginTests {
|
|
public void customLoginPage() {
|
|
public void customLoginPage() {
|
|
// @formatter:off
|
|
// @formatter:off
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
- .authorizeExchange((exchange) -> exchange
|
|
|
|
|
|
+ .authorizeExchange((authorize) -> authorize
|
|
.pathMatchers("/login").permitAll()
|
|
.pathMatchers("/login").permitAll()
|
|
.anyExchange().authenticated())
|
|
.anyExchange().authenticated())
|
|
.formLogin((login) -> login
|
|
.formLogin((login) -> login
|
|
@@ -155,7 +155,7 @@ public class FormLoginTests {
|
|
public void formLoginWhenCustomLoginPageInLambdaThenUsed() {
|
|
public void formLoginWhenCustomLoginPageInLambdaThenUsed() {
|
|
// @formatter:off
|
|
// @formatter:off
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
- .authorizeExchange((exchanges) -> exchanges
|
|
|
|
|
|
+ .authorizeExchange((authorize) -> authorize
|
|
.pathMatchers("/login").permitAll()
|
|
.pathMatchers("/login").permitAll()
|
|
.anyExchange().authenticated()
|
|
.anyExchange().authenticated()
|
|
)
|
|
)
|
|
@@ -185,7 +185,7 @@ public class FormLoginTests {
|
|
public void formLoginWhenCustomAuthenticationFailureHandlerThenUsed() {
|
|
public void formLoginWhenCustomAuthenticationFailureHandlerThenUsed() {
|
|
// @formatter:off
|
|
// @formatter:off
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
- .authorizeExchange((exchange) -> exchange
|
|
|
|
|
|
+ .authorizeExchange((authorize) -> authorize
|
|
.pathMatchers("/login", "/failure").permitAll()
|
|
.pathMatchers("/login", "/failure").permitAll()
|
|
.anyExchange().authenticated())
|
|
.anyExchange().authenticated())
|
|
.formLogin((login) -> login
|
|
.formLogin((login) -> login
|
|
@@ -212,7 +212,7 @@ public class FormLoginTests {
|
|
public void formLoginWhenCustomRequiresAuthenticationMatcherThenUsed() {
|
|
public void formLoginWhenCustomRequiresAuthenticationMatcherThenUsed() {
|
|
// @formatter:off
|
|
// @formatter:off
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
- .authorizeExchange((exchange) -> exchange
|
|
|
|
|
|
+ .authorizeExchange((authorize) -> authorize
|
|
.pathMatchers("/login", "/sign-in").permitAll()
|
|
.pathMatchers("/login", "/sign-in").permitAll()
|
|
.anyExchange().authenticated())
|
|
.anyExchange().authenticated())
|
|
.formLogin((login) -> login
|
|
.formLogin((login) -> login
|
|
@@ -233,7 +233,7 @@ public class FormLoginTests {
|
|
public void authenticationSuccess() {
|
|
public void authenticationSuccess() {
|
|
// @formatter:off
|
|
// @formatter:off
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
- .authorizeExchange((exchange) -> exchange
|
|
|
|
|
|
+ .authorizeExchange((authorize) -> authorize
|
|
.anyExchange().authenticated())
|
|
.anyExchange().authenticated())
|
|
.formLogin((login) -> login
|
|
.formLogin((login) -> login
|
|
.authenticationSuccessHandler(new RedirectServerAuthenticationSuccessHandler("/custom")))
|
|
.authenticationSuccessHandler(new RedirectServerAuthenticationSuccessHandler("/custom")))
|
|
@@ -298,7 +298,7 @@ public class FormLoginTests {
|
|
given(formLoginSecContextRepository.load(any())).willReturn(authentication(token));
|
|
given(formLoginSecContextRepository.load(any())).willReturn(authentication(token));
|
|
// @formatter:off
|
|
// @formatter:off
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
SecurityWebFilterChain securityWebFilter = this.http
|
|
- .authorizeExchange((exchange) -> exchange
|
|
|
|
|
|
+ .authorizeExchange((authorize) -> authorize
|
|
.anyExchange().authenticated())
|
|
.anyExchange().authenticated())
|
|
.securityContextRepository(defaultSecContextRepository)
|
|
.securityContextRepository(defaultSecContextRepository)
|
|
.formLogin((login) -> login
|
|
.formLogin((login) -> login
|