To secure REST services, you use Spring Security.
By adding spring security, users first need to login before they have access to any secured http calls.
There are multiple ways in implementing this, but I decided to provide my own UserDetailService which provides the security mechanism the user details that it uses to authenticate the user. The advantage of this, is that my custom UserDetails object can later be accessed within rest calls to get more information about the logged in user (in my case, I wanted the userID to be available in the REST services).
Lees meer »