I am trying to write a RESTful web service in Java 8. I'm using Glassfish (Jersey and Grizzly)
Let's take the user resource.
http://localhost:8080/geocon/users
After I mapped the HTTP Verbs, I realised that, without a proper login strategy, everyone who knows an user ID (in this example I took 007 as userId) could call a DELETE to
http://localhost:8080/geocon/users/007
actually deleting the user with ID 007. Same as PUT verb, where anyone could overwrite old data with new - without any authorization. I am using Elasticsearch for storing users (and other types of resource) as JSON documents and I was wondering if I could still use it for storing password informations.
Considered that I don't mind using the basic HTTP authentication mechanism, how do I do it in practice? How could I check if an user is actually himself and has the permission to delete or refresh data refering to him? Thanks