liveBook · Manning

Login page

As explained in Spring in Action, Sixth Edition

A custom login page is an application-provided web page through which users submit credentials for authentication.

A custom login page is an application-provided web page where users submit credentials. Spring Security can supply a plain default page, but a custom page fits the application's visual design and can include registration links or login errors. section 5.1 section 5.3.2

A Spring Security custom login page requires these connected pieces:

  • Post credentials to /login using fields named username and password unless the processing URL and parameter names are customized. section 5.3.2

Thymeleaf login form

A simple page displays a login heading and image, reports an error when authentication fails, links new users to registration, and posts username and password fields to /login.

A custom page can coexist with third-party authentication. OAuth2 or OpenID Connect can redirect unauthenticated users to a provider, while the page offers a link such as Sign in with Facebook. section 5.3.3

How Spring in Action, Sixth Edition covers it

How deep it goes
Explains routing, view mapping, form fields, error display, and redirects, but stops short of authentication-provider implementation.
Examples
Uses a Taco Cloud Thymeleaf form, /login submission, configurable parameter names, success redirects, and a Facebook sign-in link.
What it assumes
Assumes Spring Security and a template engine, while introducing HttpSecurity, view controllers, form fields, and authentication routes.
What you can do after
Build a custom Spring Security login flow with a mapped view, credential form, error message, and post-login destination.
How it connects
Connects custom login pages with Spring Security, form login, Thymeleaf, OAuth2, and OpenID Connect.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring in Action, Sixth Edition. The section links point to the parts of the book it draws on.