Articles on: Developer

AutoLogin From Your Third-Party Code

Auto Login allows you to automatically login a user from your own third-party code.

Enabling Auto Login



Enabling Auto Login functionality is a two step process:

Generate an Application Key at Settings > Security > Application Key.
Enable Auto Login at Settings > Company > General > Enable Auto Login

Using Auto Login



Using Auto Login is very simple. You simply need to create a special URL that contains the users email address, timestamp when the request was created, and generate a unique hash. You can also specify a goto parameter to redirect the user to after the auto login is successful. Please note, that after 15 minutes, the link will be expired, and a new hash must be created.

Sample Code



// URL to Clientexec
$ceURL = "https://www.clientexec.com/members/index.php?fuse=admin&action=autologin";
// SHA1 hash of your Application Key
$key = sha1('A3973FE4-FA52-FB04ACA2063B');

// URL to send the user to, after Auto Login is successful.
$goto = urlencode('index.php?fuse=support&controller=ticket&view=submitticket');

// Current Time
$timestamp = time();
// Email of the User
$email = "demouser@clientexec.com";
// Unqiue Hash to send to AutoLogin
$hash = sha1($key . $email . $timestamp);

// Full URL for AutoLogin
$url = "{$ceURL}&email={$email}&timestamp={$timestamp}&hash={$hash}&goto={$goto}";
header("Location: $url");
die();

Updated on: 02/03/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!