Client portal

Getting Started Configuring Clientexec Tips & Tricks Advanced Customization Developer Docs

AutoLogin

 February 6, 2018     0 Comments

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:
  1. Generate an Application Key at Settings -> Security -> Application Key.
  2. 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();

How helpful was this article to you?

Posting has been disabled.