Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save abhinavgarg33/7524fa1935aa2d8908ca38e9a45ad9ea to your computer and use it in GitHub Desktop.
Save abhinavgarg33/7524fa1935aa2d8908ca38e9a45ad9ea to your computer and use it in GitHub Desktop.
Not able to login to freshdesk. I am using the below written code. Can someone tell me what is the issue?? Thanks in advance!!
function getSSOUrl($strName, $strEmail) {
$time = time();
return FRESHDESK_BASE_URL.
"login/sso/?name=".
urlencode($strName).
"&email=".
urlencode($strEmail).
"&timestamp=".
$time.
"&hash=".
getHash($strName,$strEmail,$time);
}
function getHash($strName, $strEmail, $time) {
$to_be_hashed = $strName . FRESHDESK_SHARED_SECRET . $strEmail . $time;
return hash_hmac('md5', $to_be_hashed, FRESHDESK_SHARED_SECRET);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment