Trakdesk allows you to authenticate to your helpdesk using Single Sign On. The API is simple to use and implement.
With just a few lines of code, you can easily integrate SSO into your custom applications or server and allow your users to connect to your helpdesk without having to enter a separate username and password.
Enabling Simple SSO
- Login to your helpdesk as an administrator.
- Go to the Admin Page.
- Select the Security Settings option. Enable Single Sign On and select Simple SSO.
Simple SSO API
There are a few required parameters when using the Simple SSO API. Below are the required variables that you need to pass to Trakdesk SSO endpoint for authentication.
- full_name: John Doe
- email: firstname.lastname@example.org
- tstp: Unix Timestamp (UTC)
- hash: md5 hash
Here is an example using PHP 5.0 and later
//Date function $utc_date = DateTime::createFromFormat( 'Y-m-d G:i:s', date('Y-m-d h:i:s'), new DateTimeZone('UTC') ); //Required Variables $full_name = 'John Doe'; $email = 'email@example.com'; $shared_secret = 'YOUR_SHARED_SECRET'; $timestamp = strtotime($utc_date->format('Y-m-d g:i:s')); $helpdesk_url = 'YOUR_HELPDESK_URL/auth/sso'; //Optional Parameters //'auto_create_user' = false //Do not create unknown user accounts. //'redirect' = 'URL' // Redirect to a specific URL after login is successful. //Compute md5 Hash $hash = md5($full_name . $email . $timestamp . $shared_secret); //Redirect to Trakdesk SSO endpoint header('Location: https://'.$helpdesk_url.'?full_name='.urlencode($full_name).'&email='.urlencode($email).'&tstp='.$timestamp.'&hash='.$hash);
Note: For security reasons, the generated token resets every (10) minutes. If for some reason your application or server does not connect to Trakdesk SSO endpoint within this time frame, Authentication will fail. You will then need to generate a new token by executing your script again.