Authenticating over a BASIC scheme
Authenticating through a BASIC scheme is a popular solution for stateless applications like ours. Credentials are sent over with HTTP requests.
Getting ready
In this recipe, we complete the Spring Security configuration. We make it support the BASIC authentication scheme required for the application.
We slightly customize the generated response-headers, so they don't trigger the browser to show-up a native BASIC authentication form (which is not an optimal experience for our users).
How to do it...
- In order to use the Spring security namespace, we add the following filter to the
cloudstreetmarket-api web.xml
:<filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class> org.sfw.web.filter.DelegatingFilterProxy ...
Get Spring MVC Cookbook 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.