Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
SSO Login for Freshdesk support portal - PHP Sample Code (Updated)
define('FRESHDESK_SHARED_SECRET','____Place your Single Sign On Shared Secret here_____');
function getSSOUrl($strName, $strEmail) {
$timestamp = time();
$str_to_be_hashed = $strName . FRESHDESK_SHARED_SECRET . $strEmail . $timestamp;
return FRESHDESK_LOGIN_URL . '?' .
http_build_query([ // parameters urlencoded by default -
'name' => $strName,
'hash' => hash_hmac('md5', $str_to_be_hashed, FRESHDESK_SHARED_SECRET)),
'email' => $strEmail,
'timestamp' => $timestamp,
], '' , '&amp;');
header("Location: " . getSSOUrl("User's Name",""));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.