Basic Authentication Setup Java Web Application
This blog shows how to setup Basic Authentication in Web application. I am using Spring based Web Service to demonstrate the same. To start please ensure that you have spring application configured properly. On top of that i will show what changes needs to be be made to enable Basic Authentication. Securing application is one of the important activity which developer and designer has to keep in mind while designing. Basic authentication can be one of the basic security mechanism which can be enabled to secure web application or web service. Basic Authentication security is where application will expect the consumer to pass User and password in request header. In case if these values are not passed then spring framework will throw back Unauthorized error code. Following are the steps which needs to be followed. Step1: Add the spring security jar files in the application. Following are the jar files. spring-security-core.jar spring-security-config.jar spring-security-web.jar Step2: Add f...