Same applies for me: preauth is not working,
but did work before upgrading 5.0.x to 6.0.4! PHP Code:
<?php
session_start();
if ($_SESSION['authenticated'] == true && $_SESSION['auth_type'] == 'internal') {
/**
* Globals. Can be stored in external config.inc.php or retreived from a DB.
*/
$PREAUTH_KEY="1234567890123456789012345678901234567890123456789012345678901234";
$WEB_MAIL_PREAUTH_URL="https://myzimbra/service/preauth";
/**
* User's email address and domain. In this example obtained from a GET query parameter.
* i.e. preauthExample.php?email=user@domain.com&domain=domain.com
* You could also parse the email instead of passing domain as a separate parameter
*/
$user = $_SESSION['UserLogin'];
$domain="mydomain";
$email = "{$user}@{$domain}";
if(empty($PREAUTH_KEY)) {
die("Need preauth key for domain ".$domain);
}
/**
* Create preauth token and preauth URL
*/
$timestamp=time()*1000;
$preauthToken=hash_hmac("sha1",$email."|name|0|".$timestamp,$PREAUTH_KEY);
$preauthURL = $WEB_MAIL_PREAUTH_URL."?account=".$email."&by=name×tamp=".$timestamp."&expires=0&preauth=".$preauthToken;
/**
* Redirect to Zimbra preauth URL
*/
//die($preauthURL);
header("Location: $preauthURL");
} else {
header("Location: http://mydomain/index.php");
}
?>
I also tried to solve the issue by creating a new preauthentication key and restarting Zimbra - still
authentication failed although I can use it from the Admin UI.
Has the URL based mechanism been changed or removed without notifiying users...?