Form-based login authenticates web users through an application-provided credential form. In Spring Security, enabling formLogin() redirects unauthenticated requests to a login page, then permits access after successful authentication. section 6.3.2
A minimal protected Spring MVC application typically follows this sequence:
- Let Spring Security provide the login and logout pages automatically. section 6.3.2
Default destination after login
Set defaultSuccessUrl("/home", true) to send a successfully authenticated user to the application's home page. For more conditional behavior, a success handler can inspect authorities and redirect users with read access to /home and others to /error.
