By : makemakecode Published On Friday, August 05, 2016, 05:03 In PHP Scripts

1. Add domain on domains management page
2. Add user which will be used for server to server API call
3. Create API token for that user
3. Include security.php file to your project from UserRolesManager.Example.Client.Simple
5. Copy and paste user email and token (which you created) to security.php
define('APP_API_AUTHENTICATION', true); // <- true
define('APP_API_ENDPOINT', 'http://userappdomain/api');
define('APP_API_USER', 'your api user');
define('APP_API_TOKEN', 'you user API token');
and do not forget to set your user management app URL:
define('APP_USER_MANAGEMENT_URL', URL_PROTOCOL.'userappdomain');
6. Add the following code at the begining of you page
<?php
require 'security.php';
sign_in_required();
?>
After that if user is not authenticated he or she will be redirect to user manager login page. After authentication process the user will be redirected back to your site page.
The steps above you can use for all of your sites without development of authentication application each time you need, so you will have users and roles central repository.
The security.php file contains function to get user roles, so you can restrict content visibility by those roles.
v1.0.1 - September 09, 2016 (Update)
- Laravel client example application has been added;
1. Change .env file
SESSION_DOMAIN=.localhost.com (or .yourdomain.com if you have a domain)
2. You need to create a user.
3. Click on Edit User ->API tab click on Generate API Token & Secret Key
4. Open /appSSO/Libraries/security.php file
5. Copy and paste user email and token:
define('APP_API_AUTHENTICATION', true); // <- true
define('APP_API_ENDPOINT', 'http://userappdomain/api');
define('APP_API_USER', 'user email');
define('APP_API_TOKEN', 'token');
v1.0.1 - August 28, 2016 (update)
- Codeigniter client example application has been added;
User Roles Manager App:
1. You need to create a user.
2. Click on Edit User ->API tab click on Generate API Token & Secret Key
3. Open application/libraries/security.php file
4. Copy and paste user email and token:
(Do not forget to set correct API Endpoint URL)
define('APP_API_AUTHENTICATION', true); // <- true
define('APP_API_ENDPOINT', 'http://userappdomain/api');
define('APP_API_USER', 'user email');
define('APP_API_TOKEN', 'token');
v1.0.1 - August 15, 2016
- Twitter bootstrap & schemes update to 3.3.7
- Sub directory installation (Multiple installation in a subdirectory)
- Cross domain authentication simple implementation
User Roles Manager App:
1. You need to create a user.
2. Click on Edit User ->API tab click on Generate API Token & Secret Key
Advance Example:
1. Open pplicationmodulesConfigurationConfig.php
2. Copy and paste user email and token:
define('APP_API_AUTHENTICATION', true); // <- true:
define('APP_API_ENDPOINT', 'http://userappdomain/api');
define('APP_API_USER', 'user email');
define('APP_API_TOKEN', 'token');
Simple Example:
1. Open security.php file
2. Copy and paste user email and token:
define('APP_API_AUTHENTICATION', true); // <- true
define('APP_API_ENDPOINT', 'http://http://userappdomain/api');
define('APP_API_USER', 'user email');
define('APP_API_TOKEN', 'token');
v1.0.0 - August 4, 2016
- Initial release
Designed with multi-purpose Bootstrap-powered HTML templates, will look the same in all modern popular browsers. Free bootswatch themes are included.
The application is based on extremely lightweight micro-framework without using heavy components. Standard modules and functions have been used only.
Multisite’s and multi-configuration’s support. Use the same website instance to manage different web sites and their users and roles.
You are welcome to the author technical support forums to ask any question and leave your requests and ideas and wishes.