Using Spring Security tags

At the start of this chapter, we saw how to serve and process web forms. In that exercise, we created a web page to add products. Anyone with access to the add products page can add new products to our web store. However, in a typical web store, only the administrator can add products. So, how do we restrict other users from accessing the add products page? There comes Spring Security to help us.

Spring Security is a vast topic, so we are not going to see all of the capabilities of Spring Security; instead, we are only going to see how to add basic authentication to our web pages.

Get Spring MVC Beginner’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.