I tried to login with my own login page and following error:
Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Tue Aug 22 07:52:15 CEST 2017 There was an unexpected error (type=Not Found, status=404). No message available
Here ist my SecurityConfiguration
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/login", "/css/**",
"/image/**").permitAll().anyRequest()
.authenticated().and().formLogin().loginPage("/login.html").permitAll()
.and().logout().permitAll().and().csrf().disable();
}
@Autowired
protected void configureLDAP(AuthenticationManagerBuilder auth) throws Exception {
auth.ldapAuthentication().userSearchFilter("uid={0}").contextSource()
.url("ldap://ldap.forumsys.com:389/dc=example,dc=com").managerPassword("password");
}
Login
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>Login</title>
<meta name="description" content="description">
<meta name="author" content="author">
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div class="container">
<div class="background"> </div>
<div class="card">
<img style="height:60px; width: auto; margin: 45px 100px;" src="image/picture.png">
<form name="f" action="/login" method="POST">
<div class="input">
<input placeholder="Benutzername" type="text" class="" name="username" required>
</div>
<div class="input">
<input placeholder="Passwort" type="password" class="" name="password" required>
</div>
<div class="">
<input name="submit" value="Login" class="btn" type="submit">
</div>
</form>
</div>
</div>
</body>
</html>
With the Login page from Spring it works without problems.