You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
protectedvoidconfigure(HttpSecurityhttp) throwsException {
http
.authorizeRequests()
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login")
.permitAll(); // ne pas soumettre à l'authentification, la page de connexion
}
Exemple de page d'authentification
<c:urlvalue="/login" var="loginUrl"/><formaction="${loginUrl}" method="post"><c:iftest="${param.error != null}"><p>Invalid username and password.</p></c:if><c:iftest="${param.logout != null}"><p>You have been logged out.</p></c:if><p><labelfor="username">Username</label><inputtype="text" id="username" name="username"/></p><p><labelfor="password">Password</label><inputtype="password" id="password" name="password"/></p><inputtype="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/><buttontype="submit" class="btn">Log in</button></form>