We want to add spring to security to our spring boot application
The problem is that we have already /login path used already
So currently we can't load spring security default login page which redirect to /login path
We want to keep the spring default login form, just to change the path it uses,
Meaning, using the default behavior/implementation, only the default (form and process) paths need to be changed (without need to create html)
We didn't find any relevant property or code (or answer) to override it
I see in DefaultLoginPageGeneratingFilter the default
public static final String DEFAULT_LOGIN_PAGE_URL = "/login";
EDIT
Tried the setLoginPageUrl method suggested by @jannis
@Component
public class LoginFormFilter extends DefaultLoginPageGeneratingFilter {
@PostConstruct
private void init() {
setLoginPageUrl("/api/login");
}
@Override
public String getLoginPageUrl() {
return "/api/login";
}
}
But still getting the default login page
Also failed to override using loginPage method
@Override
protected void configure(HttpSecurity http) throws Exception {
....formLogin().loginPage("/api/login");