WebMail Lite 7 documentation

Integration via Single Sign-On

While the product supports logging in programmatically, existing method isn't 100% perfect. It requires having main system and webmail application installed within the same domain, and it might present security issues if you transfer login credentials via GET or POST.

In version 7.4, a different method known as Single Sign-On was implemented to allow for eliminating these issues. It's invoked in a very simple and straightforward way:

<?php

include_once __DIR__.'/libraries/afterlogic/api.php';

if (class_exists('CApi') && CApi::IsValid())
{
	header('Location: ../?sso&hash='.CApi::GenerateSsoToken('test@domain.com', 'password'));
}
else
{
	echo 'AfterLogic API isn\'t available';
}

It's assumed that the script is placed into one of direct subdirectories of main webmail directory, examples for instance. You can also supply direct URL like this:

header('Location: http://yourdomain.com/webmail/?sso&hash='.CApi::GenerateSsoToken('test@domain.com', 'password'));

This approach allows for integration with ownCloud as well as other systems.