To do this, go to Customization > Styling and Front-end Settings > Access, and scroll down to the "Single Sign-On" group of settings:
Here you can also change the following options.
Upload the /examples/sso/ folder to a web server with PHP support. This could be a remote server in relation to the server where KMP installed. Please do not upload it a sub-folder of KMP, it won't work!
Edit the simple_sample.php file and follow the instructions provided by the inline comments. Briefly, you just need to copy paste SSO URL, Account Key, and SSO Key from SSO settings in KMP to this script.
Run this script by opening its URL in your browser. You will be provided with a login link. Click on it to login to KMP.
If you would like to login user automatically, without asking them to click the login link, you can display a 1px*1px image on the page which is shown to user after login. Use the same URL for "src" parameter of the image.
Please note that in this case users who are using Internet Explorer, might need to add the website with SSO script to exceptions (if SSO script and KMP are running on different domains).
From the Sample Script to the Real Case
Now that you've got a working sample script, you can integrate it to your website or portal. Surely you do not need the sample script itself as a separate file, but you have to copy its contents (everything that goes between <?php and ?> tags) to the place on your portal, where you wish a user to be logged in automatically (either after a click, or immediately). Usually it should be the page, which is displayed to the user after he logs in to your portal. Also you would need the other two files (sso.utils.php and rijndael.php).
There are just a few things you need to modify.
There is $user_data array within the sample script. We define a sample user account details here. In the sample script they are hardcoded, but in a real situation you'll need to pass actual user details to it.
The "login" is always required. Password is not used, the SSO key is passed to KMP for authentication instead.
The "first name", "last name", "email", and "groups" are required only if the user doesn't exist in KMP yet, so these details would be needed to setup an account for him. They also can be used to update the user account details in KMP. For example, if a user's email has been changed in your system, the next time you log him in via SSO you can pass the new email via this array and it will be updated in his account details in KMP. You might want to pass these details each time a user logs in, so that his account in KMP would be always up to date. If a parameter is empty, then it will not be changed in user's profile in KMP. To sum up, there parameters are optional, but it is a good idea to pass them each time user logs in just to keep his account up-to-date.
The "groups" parameter is another array, which can be empty...
...or may hold one or multiple group IDs separated by commas.
If at least one group ID is specified, user will be assigned to that group or groups upon login. Please note that user will be unassigned from any other groups in this case, i.e. he will be unassigned from all groups he belonged to, and then assigned to the groups specified by this parameter.
To find out how groups and their IDs match, simply go to Groups & Users > Staff > Manage Staff (or Groups & Users > Clients > Manage Clients) page and you will see group IDs in the first column.
Another thing that you may wish to change is the text of the link, which points to KMP (highlighted below).
If a login attempt fails in the sample script, it returns the error to the screen.
You might want to write errors to a log file, instead.
That's all. If you would need any help or have some questions, feel free to contact our support.