Ok I’m following this tutorial for a basic PHP webservice server/client setup:
http://www.java-samples.com/showtutorial.php?tutorialid=1186
Now I’m wanting to add a user authentication and have the functionality working but wanted to know if the user doesn’t authenticate how can I return an http Status 401 Unauthorized?
I’m not using HTTP to authenticate (using user,pass and salt against a database) but have the functionality working for this. Is there something I can set to notify http that the user is not authorised? Or am I looking at this the wrong way?
Thanks for any helpful tips
401is specifically designed to signal the use of HTTP authentication.401 Unauthorizedresponses MUST include aWWW-Authenticate, but the opposite is not true.