Issue Details (XML | Word | Printable)

Key: DIRSERVER-365
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Trustin Lee
Reporter: Giamma
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Directory ApacheDS

Custom authenticator is never called

Created: 06/Jul/05 07:16 AM   Updated: 21/Apr/07 11:13 AM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Resolution Date: 12/Aug/05 04:50 PM


 Description  « Hide
I wrote a custom authenticator that will authenticate against our database.
The problem is that it's never called in AuthenticationService.process().

It looks like process() will loop through the configured authenticator, starting with the default one:

  for (Iterator i = authenticators.iterator(); i.hasNext(); idx++) {
            try {
                Authenticator authenticator = (Authenticator) i.next();

                // perform the authentication

                LdapPrincipal authorizationId = authenticator.authenticate(ctx);

                .....
             }
 }

Unfortunately SimpleAuthenticator will generate a LdapNameNotFoundException exception and process() will just bail out.
Instead it should try the next authenticator.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alex Karasulu made changes - 12/Aug/05 12:14 AM
Field Original Value New Value
Assignee Alex Karasulu [ akarasulu ] Trustin Lee [ trustin ]
Alex Karasulu added a comment - 12/Aug/05 12:15 AM
It might be a good idea to get Endi's commentary on this issue.

Endi S. Dewata added a comment - 12/Aug/05 01:20 AM
Hi, I can't find the process() method in AuthenticationService. Maybe it's from an older code?

In the current code the work is done in AuthenticationService.authenticate(). The way it works is it will attempt to authenticate using each authenticator. If one fails, it will try the next one until it finds the first authenticator that doesn't throw an exception. If all authenticators fail, the authenticate() method itself will throw an LdapAuthenticationException. Hope this helps.

Endi

Repository Revision Date User Message
ASF #232227 Fri Aug 12 07:49:35 UTC 2005 trustin DIREVE-178
* Fixed SimpleAuthenticator not to throw LdapNameNotFoundExecption.
* Made AuthenticationService to log unexpected exceptions while authenticating.
Files Changed
MODIFY /directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authn/AuthenticationService.java
MODIFY /directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authn/SimpleAuthenticator.java

Trustin Lee added a comment - 12/Aug/05 04:50 PM
I checked in the fix. Now it should work as you expected.

Trustin Lee made changes - 12/Aug/05 04:50 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 0.9.2 [ 12310192 ]
Resolution Fixed [ 1 ]
Alex Karasulu made changes - 10/Feb/06 12:34 PM
Key DIREVE-178 DIRSERVER-365
Component/s server main [ 11494 ]
Fix Version/s 0.9.2 [ 12310192 ]
Project Directory Server [ 10516 ] Directory ApacheDS [ 12310260 ]
Affects Version/s 0.9 [ 11003 ]
Emmanuel Lecharny added a comment - 21/Apr/07 11:13 AM
Closing all issues created in 2005 and before which are marked resolved

Emmanuel Lecharny made changes - 21/Apr/07 11:13 AM
Status Resolved [ 5 ] Closed [ 6 ]