Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
  #1 (permalink)  
Old 05-12-2008, 02:59 PM
jginzburg jginzburg is offline
Junior Member
 
Join Date: May 2008
Posts: 3
jginzburg is on a distinguished road
Question Custom Auth problem

Hello,

I´ve implemented a Radius Custom Auth extension, as depicted in the Admin Guide.
This is currently its (very simplified) source:
public class RadiusCustomAuth extends ZimbraCustomAuth {
Logger logger;
public void authenticate(Account account, String pass,
Map<String, Object> arg2, List<String> arg3) throws Exception {
logger.info("RadiusCustomAuth: authenticating...");
}

public RadiusCustomAuth() {
super();
Logger logger = Logger.getLogger(this.getClass().getName());
logger.info("RadiusCustomAuth created");
}
}
I've hooked it to the Zimbra server using the Zimbra extension framework.I've registered this custom auth mechanism under the name "Radius" and I've also enabled the example.com domain for using this handler (by using zmprov modifydomain example.com zimbraAuthMech custom:Radius).
When I restart the server I can see in the log that my RadiusCustomAuth handler is loaded because the line "RadiusCustomAuth created" is printed.
But when I try to authenticate a user, instead of "RadiusCustomAuth: authenticating..." this is the log I get:

2008-05-12 18:36:27,214 INFO [btpool0-0] [] AuthProvider - Adding auth provider: zimbra com.zimbra.cs.service.ZimbraAuthProvider
2008-05-12 18:36:27,322 INFO [btpool0-0] [ua=zclient/5.0.5_GA_2201.RHEL5;oip=10.8.13.18;] SoapEngine - handler exception: authentication failed for user01@example.com,

The Radius handler is associated to this domain (I'm sure on this because if I associate an inexistent handler to this domain I get "handler anInexistentHandler for custom auth for domain example.com not found" when authenticating the user).

Any ideas why I'm getting this handler exception instead of my silly log?
Reply With Quote
  #2 (permalink)  
Old 06-26-2008, 10:36 AM
Greg Greg is offline
Zimbra Employee
 
Join Date: Sep 2005
Location: Belmont, CA
Posts: 115
Greg is on a distinguished road
Default

Looks like you are doing everything correctly. A couple of questions:
- how do you know that your auth handler is not being triggered?
- what is the log level in /opt/zimbra/conf/log4j.properties.in
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
P.S.: don't forget to vote on this bug
add Samba LDAP entries to Exchange Migration Tool
Reply With Quote
  #3 (permalink)  
Old 06-26-2008, 10:44 AM
Greg Greg is offline
Zimbra Employee
 
Join Date: Sep 2005
Location: Belmont, CA
Posts: 115
Greg is on a distinguished road
Default

Another comment, your extension should consist of minimum two classes
1) class that implements ZimbraExtension
2) class that extends ZimbraCustomAuth
MANIFEST file in the jar has to point to the class that implements ZimbraExtension, e.g.:

Code:
Zimbra-Extension-Class: com.zimbra.cs.service.radius.RadiusCustomAuth
Class that implements ZimbraExtension should have "init" method that will register the extension at run-time:


Code:
public class RadiusAuthModuleExtension implements ZimbraExtension {
    public void init() {

        ZimbraCustomAuth.register("radius", new RadiusAuth());
    }

    public void destroy() {
        ExtensionDispatcherServlet.unregister(this);
    }
    
    public String getName() {
        return "radius";
    }
}
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
P.S.: don't forget to vote on this bug
add Samba LDAP entries to Exchange Migration Tool
Reply With Quote
  #4 (permalink)  
Old 07-03-2008, 09:08 AM
dlopezleon dlopezleon is offline
Junior Member
 
Join Date: Jul 2008
Posts: 1
dlopezleon is on a distinguished road
Default

Hi Greg, thank you for answering.
We solved that problem. As you said we were doing things fine (I just added the destroy method you gave us but the problem wasn't there).
The thing was that the users we tried to authenticate were users that didn't have an account in our zimbra. We though that it would first check if the user was valid and then try to get the right inbox, but it was the other way around (which makes more sense now :P).
Thanks for your help.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to deploy a Custom Auth Handler? jginzburg Developers 1 05-12-2008 09:42 AM
memcached and nginx pop3/imap auth problem. serivo Administrators 3 04-22-2008 09:13 AM
New Installation Postifix Problem ranpel Administrators 4 12-19-2007 09:28 AM
[SOLVED] NE Migration: SMTP AUTH Failure markpr Installation 14 10-03-2007 12:51 PM


freshmeat.net sourceforge.net The best Java IDE



 

Search Engine Optimization by vBSEO 3.0.0