Spring Security for Spring RESTful web service using the cURL tool
In this example we are using the Spring Security API classes and interfaces explicitly. We will authenticate the RESTful web service using the curl
command. With the cURL tool, you can transfer data with the URL. It can be used to test the authentication. It's the same book service example which has some explicit Spring Security related API classes such as AuthenticationEntryPoint
and SimpleURLAuthenticationSuccessHandler
. Here, the goal is to demonstrate their internal usage in Spring Security.
Getting ready
Implement the
AuthenticationEntryPoint
interface and configure in the XML fileExtend
SimpleUrlAuthenticationSuccessHandler
and configure in the XML fileConfigure the
Application-security.xml
fileAdd security related filters to the
Web.xml
fileDownload the cURL tool for your operating system
How to do it...
The following are the steps for applying the Spring Security authentication and authorization mechanism by using AuthenticationEntryPoint...