Reputation: 395
I have managed to integrate spring security to my GWT application using the following approach:
http://technowobble.blogspot.com/2010_05_01_archive.html
Note that I used the gwtrpcspring library for basic spring integration with GWT and it works well (non-invasive and efficient).
My question for which I can't seem to find the answer for is how do I use spring security in my GWT widgets based on Authorization - for example, I wouldn't want to show a menu item or a save option to a user who doesn't have the authority for these. Of course, my methods are protected at the server side, but I wouldn't want a user to click on something only then to find out they have no access to it. I don't want to litter my presentation logic with security related code (if-else blocks) if possible.
Is there something equivalent of the spring security jsp tag library that can be used within GWT client code? Or do we have to build up something on our own?
Upvotes: 3
Views: 1455
Reputation: 1528
Everything you need is just to add Spring Security framework into your project.
You can ask server using RPC call at application start (after successful login) which user is current user and which roles he has.
I offer you to use my project hosted on https://code.google.com/p/gspring for simple and clear GWT and Spring integration.
Upvotes: 0
Reputation: 1664
No - there is no equivalentand what I have done is setup a user role profile and passed this over at login which is in then published to the presenters that handle accordingly..
Ian
Upvotes: 1