Basic authentication with GWT and Spring Security
We will demonstrate Basic authentication in GWT. It's very similar to the basic authentication that we are going doing in later recipes. We will be editing the applicationContext.xml
.
Getting ready
Create a sample GWT project
Add the spring related JARs in the build path
Add the Spring Security related JARs
Add the
applicationContext.xml
fileEdit the
web.xml
file as shown in the previous sectionAlso add the spring related JARs in the
web-inf lib
folder
How to do it...
Edit the applicationContext.xml
file:
<http auto-config="true" > <intercept-url pattern="/basicgwtauth/**" access="ROLE_AUTHOR"/> <intercept-url pattern="/basicgwtauth/**" access="ROLE_AUTHOR"/> <intercept-url pattern="/**/*.html" access="ROLE_AUTHOR"/> <intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY" /> <http-basic /> </http> <authentication-manager> <authentication-provider> <...