1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Polish Default Login Page

Issue gh-17901
This commit is contained in:
Josh Cummings
2025-09-19 15:48:58 -06:00
parent 42376e2eee
commit 50ebd467c3
4 changed files with 44 additions and 23 deletions
@@ -402,7 +402,7 @@ public class FormLoginConfigurerTests {
UserDetails user = PasswordEncodedUser.user();
this.mockMvc.perform(get("/profile").with(user(user)))
.andExpect(status().is3xxRedirection())
.andExpect(redirectedUrl("http://localhost/login?authority=FACTOR_PASSWORD"));
.andExpect(redirectedUrl("http://localhost/login?factor=password"));
this.mockMvc
.perform(post("/ott/generate").param("username", "rod")
.with(user(user))
@@ -418,11 +418,11 @@ public class FormLoginConfigurerTests {
user = PasswordEncodedUser.withUserDetails(user).authorities("profile:read", "FACTOR_OTT").build();
this.mockMvc.perform(get("/profile").with(user(user)))
.andExpect(status().is3xxRedirection())
.andExpect(redirectedUrl("http://localhost/login?authority=FACTOR_PASSWORD"));
.andExpect(redirectedUrl("http://localhost/login?factor=password"));
user = PasswordEncodedUser.withUserDetails(user).authorities("profile:read", "FACTOR_PASSWORD").build();
this.mockMvc.perform(get("/profile").with(user(user)))
.andExpect(status().is3xxRedirection())
.andExpect(redirectedUrl("http://localhost/login?authority=FACTOR_OTT"));
.andExpect(redirectedUrl("http://localhost/login?factor=ott"));
user = PasswordEncodedUser.withUserDetails(user)
.authorities("profile:read", "FACTOR_PASSWORD", "FACTOR_OTT")
.build();
@@ -438,7 +438,7 @@ public class FormLoginConfigurerTests {
this.mockMvc.perform(get("/login")).andExpect(status().isOk());
this.mockMvc.perform(get("/profile").with(SecurityMockMvcRequestPostProcessors.x509("rod.cer")))
.andExpect(status().is3xxRedirection())
.andExpect(redirectedUrl("http://localhost/login?authority=FACTOR_PASSWORD"));
.andExpect(redirectedUrl("http://localhost/login?factor=password"));
this.mockMvc
.perform(post("/login").param("username", "rod")
.param("password", "password")
@@ -793,7 +793,8 @@ public class FormLoginConfigurerTests {
static class MfaDslConfig {
@Bean
SecurityFilterChain filterChain(HttpSecurity http, AuthorizationManagerFactory<RequestAuthorizationContext> authz) throws Exception {
SecurityFilterChain filterChain(HttpSecurity http,
AuthorizationManagerFactory<RequestAuthorizationContext> authz) throws Exception {
// @formatter:off
http
.formLogin(Customizer.withDefaults())
@@ -824,7 +825,8 @@ public class FormLoginConfigurerTests {
static class MfaDslX509Config {
@Bean
SecurityFilterChain filterChain(HttpSecurity http, AuthorizationManagerFactory<RequestAuthorizationContext> authz) throws Exception {
SecurityFilterChain filterChain(HttpSecurity http,
AuthorizationManagerFactory<RequestAuthorizationContext> authz) throws Exception {
// @formatter:off
http
.x509(Customizer.withDefaults())