I need some guidance with a task I've been assigned.
I have to create a java web application which will provide some functionalities and create a REST API for all the user actions and also pass credentials both to the web page and the API (i.e. I need to ensure that the API gives data only to the correct user).
So, I implemented the REST services with Spring but I'm not totally sure about how to pass the credentials, I mean, when I log in I send the user and password to the web page, but how can I pass them also to the API? I read a couple of SO posts suggesting OAuth, but I don't need to authenticate users from another applications, is there any other option?