This is a basic user manager for web apps. It's a stand-alone website that verifies user information and then redirects back to the main app. This allows you to focus on web apps themselves instead of the user verification system. It's written in HTML, JavaScript, and PHP.
The user manager is a stand alone page on the site. Each web app checks to see if it was passed a user code. If it was, it makes a quick API call to verify that the code is valid. If the code doesn't exist or is not valid it simply re-directs the user to the user manager which takes care of the login process.
I've built the user manager so that it's very easy to use. In each app I include only one line of code.
include '../user/api/user.php';
The user.php script will automatically verify the user value passed to the current script and re-direct the user as needed.
Normally, your web app will pass the user id (hash) code to the verify script to make sure that it's a valid id. Here's an example of passing a hash code.
http://www.example.com/user/api/verify.php?h=2e870a64a151565480879ef579041d0e
If you want to verify username and password in the web app itself you can also pass those to the verify script. Here's an example of passing username and password.
http://www.example.com/user/api/verify.php?u=codazoda&p=h76EOJj76
In either case, the script will return either the user id, on success, or the word error if it could not be verified.
This source code is distributed under the MIT License.