This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('FRESHDESK_SHARED_SECRET','____Place your Single Sign On Shared Secret here_____'); | |
define('FRESHDESK_BASE_URL','http://{{your-account}}.freshdesk.com/'); //With Trailing slashes | |
function getSSOUrl($strName, $strEmail) { | |
$timestamp = time(); | |
$to_be_hashed = $strName . FRESHDESK_SHARED_SECRET . $strEmail . $timestamp; | |
$hash = hash_hmac('md5', $to_be_hashed, FRESHDESK_SHARED_SECRET); | |
return FRESHDESK_BASE_URL."login/sso/?name=".urlencode($strName)."&email=".urlencode($strEmail)."×tamp=".$timestamp."&hash=".$hash; | |
} |