What are the best strategies to secure your GWT + Tomcat app to perform authentication and authorization?
Therea are two basic strategies:
The simplest way is to restrict access to the html/js files generated by GWT using regular web application security tools:
This can allow you to have an e.g. AdminEntryPoint
and UserEntryPoint
.
If the above solution is not enough, you can dig deeper. I have done so with Spring Security. I have not found a 100% clean way of integrating Spring Security with GWT, so I added a bit of glue. Briefly:
@AllowedRoles
which enumerates the user roles allowed to access that service method;UserDetailsService
which allows inspection of the current user ( see the SecurityContextHolder javadoc for details);If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With