restful-spring-security

Small test RESTful app with token based security. Its main reason is documentation for myself. :-) This demo features:

Demo does not feature any front-end JavaScript. Sorry. You have to use browser, preferably with something like http://restclient.net/ - or even better with curl command.

Companion blog post: http://virgo47.wordpress.com/2014/07/27/restful-spring-security-with-authentication-token/

Diagram!

UML class diagram, yeah! That's what I missed most when I read Spring Security 3.1 book, actually. So hopefully you'll like it. If it does not make sense, let me know what's wrong with it. (BTW, check aforementioned blog post for sequence diagrams of login/logout/token check, etc.)

UML Class diagram

Sources, inspiration

Demo is inspired by internal needs, took a lot of information from Google and StackOverflow - which lead me to: https://github.com/philipsorst/angular-rest-springsecurity/ That project has additional AngularJS and JPA, while I wanted to focus on Spring Security + MVC's @RestController only + practice Gradle a bit.

Notes

TODO

Examples

Assuming you started the boot application (gradle bootRun) then the app runs on port 8080 and root context - and you can try following curl commands:

Test

See test.sh for simple bash-based automatic test. Never wrote bash test before, but it works for me here. :-)