Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-23-2009, 04:58 PM
Member
 
Posts: 10
Unhappy PreAuth Problem

i have this link but its saying

HTTP ERROR 400

Problem accessing /service/preauth. Reason:

authentication failed for test@test.local

http://zimbra.test.local/service/pre...XXXXXXXXXXXXXX

any suggestions?
is my link correct?
Reply With Quote
  #2 (permalink)  
Old 11-23-2009, 11:09 PM
Zimbra Consultant & Moderator
 
Posts: 20,316
Default

Quote:
Originally Posted by jputz12 View Post
i have this link but its saying

HTTP ERROR 400

Problem accessing /service/preauth. Reason:

authentication failed for test@test.local

http://zimbra.test.local/service/pre...XXXXXXXXXXXXXX

any suggestions?
is my link correct?
It doesn't say the url is incorrect it says that you failed authentication. I assume you followed the wiki article exactly?
__________________
Regards


Bill
Reply With Quote
  #3 (permalink)  
Old 11-24-2009, 12:23 AM
Elite Member
 
Posts: 296
Default

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.
Reply With Quote
  #4 (permalink)  
Old 11-24-2009, 10:07 AM
Member
 
Posts: 10
Default

yeah i already COPY and Paste the code from the wiki and its not working
Reply With Quote
  #5 (permalink)  
Old 11-27-2009, 01:25 AM
Elite Member
 
Posts: 296
Default

you should modify it before you use it, and nobody knows what code you got from the wiki?
Reply With Quote
  #6 (permalink)  
Old 12-29-2009, 08:13 AM
Senior Member
 
Posts: 71
Unhappy PHP preauth

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&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...?
Reply With Quote
  #7 (permalink)  
Old 12-29-2009, 08:30 AM
Senior Member
 
Posts: 71
Default

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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.