I\'m creating a REST web service using spring and I need to implement login/logout functions in it. The url for the functions should be something like .../api/login and .../api/
The best way is to plugin your authentication implementation into Spring Security. You can do it by registering your own "authentication provider" into Spring Security.
For example:
Another thing: I know it's a time consuming, but after reading Spring Security reference you will definitely get the "big picture" :-)