I need help for the design of my web app. I want to do a REST web service that needs authentication, and a web app that access this web service to get the data. All the users are stocked in an external database (like openldap, active directory, or whatever).
_____________ __________________
| | | |
| web app |----->| REST service |
|_____________| |__________________|
_______________
| |
| user db |
|_______________|
The question is: do I need to make the authentication on the web app and the web service, or can the web app verify the login through the web service?
Hope my question is understandable enough
EDIT : to clarify the situation: my web service is standalone and any kind of applications could access it (like web app, smartphone app, curl, etc...). I think my question needs clarifications too. I want to know if it's possible to make all the authentication logic in the service. I imagine something like that:
- The app queries the ressource
http://mywebservice.com/loginwith an HTTP basic authentication - If the credentials are valid, the response will be something like
{"loginStatus":true}, orfalseif they're invalid.
Is it a possible solution? Is it secure?