Form-based authentication with GWT and Spring Security
We will demonstrate Form-based authentication in GWT. It's very similar to the authentication that we have done in our previous 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
file. - Edit the
web.xml
file as shown in the previous section. - Also 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" ...