PreAuth Problem

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
jputz12
Posts: 10
Joined: Sat Sep 13, 2014 12:48 am

PreAuth Problem

Postby jputz12 » Mon Nov 23, 2009 6:58 pm

i have this link but its saying
HTTP ERROR 400
Problem accessing /service/preauth. Reason:
authentication failed for test@test.local

any">http://zimbra.test.local/service/preauth?account=test@test.local&by=name&timestamp=1258499444000&expires=0&preauth=XXXXXXXXXXXXXXXXXXXXXXXXX
any
suggestions?

is my link correct?


phoenix
Ambassador
Ambassador
Posts: 26697
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

PreAuth Problem

Postby phoenix » Tue Nov 24, 2009 1:09 am

[quote user="jputz12"]i have this link but its saying
HTTP ERROR 400
Problem accessing /service/preauth. Reason:
authentication failed for test@test.local

any">http://zimbra.test.local/service/preauth?account=test@test.local&by=name&timestamp=1258499444000&expires=0&preauth=XXXXXXXXXXXXXXXXXXXXXXXXX
any
suggestions?

is my link correct?[/QUOTE]It doesn't say the url is incorrect it says that you failed authentication. I assume you followed the wiki article[/URL] exactly?
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
tiger2000
Outstanding Member
Outstanding Member
Posts: 296
Joined: Fri Sep 12, 2014 11:31 pm

PreAuth Problem

Postby tiger2000 » Tue Nov 24, 2009 2:23 am

in most cases, you should call zimbra preauth login via program(php, java, jsp....), cause you need to pass several parameters to zimbra (some of them need to be calculated first) :
1. email account

2. time (in mini-second format? if i remember correctly)

3. hash-key value (using SHA1?)
as Phoenix said, everything is written in that Preauth wiki article.
jputz12
Posts: 10
Joined: Sat Sep 13, 2014 12:48 am

PreAuth Problem

Postby jputz12 » Tue Nov 24, 2009 12:07 pm

yeah i already COPY and Paste the code from the wiki and its not working :(
tiger2000
Outstanding Member
Outstanding Member
Posts: 296
Joined: Fri Sep 12, 2014 11:31 pm

PreAuth Problem

Postby tiger2000 » Fri Nov 27, 2009 3:25 am

you should modify it before you use it, and nobody knows what code you got from the wiki?
catnipper
Advanced member
Advanced member
Posts: 71
Joined: Fri Sep 12, 2014 11:45 pm

PreAuth Problem

Postby catnipper » Tue Dec 29, 2009 10:13 am

Same applies for me: preauth is not working, but did work before upgrading 5.0.x to 6.0.4!

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&timestamp=".$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...?
catnipper
Advanced member
Advanced member
Posts: 71
Joined: Fri Sep 12, 2014 11:45 pm

PreAuth Problem

Postby catnipper » Tue Dec 29, 2009 10:30 am

I promise I will check my timeservers.

I promise I will check my timeservers.

I promise I will check my timeservers.

I promise I will check...
Solved :)
bullrem
Posts: 3
Joined: Sat Sep 13, 2014 2:34 am

PreAuth Problem

Postby bullrem » Sat Jun 09, 2012 5:33 am

Trouble Shooting
Doesn't Work After Upgrade Of ZCS

Please check the data/time on your servers. If they are off by more than 5 minutes preauth will fail.

Return to “Developers”

Who is online

Users browsing this forum: No registered users and 3 guests