Securing a Rest API with Spring Security
Most Spring Tutorials available online teach you how to secure a Rest API with Spring with examples which are far from real application problematics. You surely agree that most tutorials lack real-world use-cases.
This tutorial aims to help you secure a real-world application, not just another Hello World Example.
In this tutorial we'll learn:
- How to secure a Spring MVC Rest API using Spring Security,
- Configure Spring Security with Java code (no painful XML),
- And delegate authentication to a UserAuthenticationService with your own business logic.
I've spent several weeks tweaking Spring Security to come up with this simple setup. Let's go!
Complete Source code is available on Github.