[Solved] spring boot security Start Error: ‘login.html?error‘ is not a valid redirect URL

Configure custom login page

http.formLogin().loginPage("login.html")  //Custom login page The error is caused by this, the page needs to be preceded by a slash
                .loginProcessingUrl("/login") // the address of the action in the login form, which is the path of the authentication request
                .usernameParameter("username")
                .passwordParameter("password")
                .defaultSuccessUrl("/home"); //Default jump path after successful login

Change to

http.formLogin().loginPage("/login.html")
                .loginProcessingUrl("/login")
                .usernameParameter("username")
                .passwordParameter("password")
                .defaultSuccessUrl("/home");

Read More: