Return-Path: X-Original-To: apmail-directory-users-archive@www.apache.org Delivered-To: apmail-directory-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 53E15F694 for ; Mon, 1 Apr 2013 16:26:32 +0000 (UTC) Received: (qmail 59429 invoked by uid 500); 1 Apr 2013 16:26:31 -0000 Delivered-To: apmail-directory-users-archive@directory.apache.org Received: (qmail 59051 invoked by uid 500); 1 Apr 2013 16:26:25 -0000 Mailing-List: contact users-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@directory.apache.org Delivered-To: mailing list users@directory.apache.org Delivered-To: moderator for users@directory.apache.org Received: (qmail 88764 invoked by uid 99); 1 Apr 2013 11:25:03 -0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 532841.37970.bm@omp1055.mail.bf1.yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1364815072; bh=u34JBlEWj2KsmFEXFaMoNImNjwjp+6p9ujDOjd5B8+4=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=5BnLRdmCiuKlNEo6db/5gVdpvLahRcP2946P8McZxan0wdLnILVxtV3lHtQGUuuFf9I7tVZt/9ilVQOfGJQSKXeDkzVoSNIaz3nK5aieyyYAV2bMQwu/xQ4j+qwUoIhrvrXMSHS8K18U+I2J65rfSzYoEZ6jAaGiv+zHKNR7tB8= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To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uIHNlZSB0aGF0IG15IGNsYXNzIGlzIGdldHRpbmcgbG9hZGVkIChjb25zdHJ1Y3QBMAEBAQE- X-Mailer: YahooMailWebService/0.8.140.532 Message-ID: <1364815072.9686.YahooMailNeo@web161806.mail.bf1.yahoo.com> Date: Mon, 1 Apr 2013 04:17:52 -0700 (PDT) From: Denis Mikhalkin Reply-To: Denis Mikhalkin Subject: Configuring custom authenticator for ApacheDS 2.0.0-M11 To: "users@directory.apache.org" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="1665047788-760331314-1364815072=:9686" X-Virus-Checked: Checked by ClamAV on apache.org --1665047788-760331314-1364815072=:9686 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi,=0A=0AI'm written a custom authenticator (org.apache.directory.server.co= re.authn.Authenticator) and configured it at "ou=3Dauthenticators,ads-inter= ceptorId=3DauthenticationInterceptor,ou=3Dinterceptors,ads-directoryService= Id=3Ddefault,ou=3Dconfig". I can see that my class is getting loaded (const= ructor invoked), however its authenticate method never gets called.=0A=0AAf= ter digging through the source code I found the following suspicious sequen= ce of actions:=0A- The DirectoryService is getting created by createDirecto= ryService in ServiceBuilder=0A- That calls createInterceptors() which creat= es the AuthenticationInterceptor. It reads the properties and creates my au= thenticator class=0A- It then calls setAuthenticators with the array of aut= henticators which then calls register for each one of them=0A- Register cal= ls init however the directoryService is null (?!?) [1]=0A=0A =A0at org.apac= he.directory.server.core.authn.AuthenticationInterceptor.register(Authentic= ationInterceptor.java:276)=0A =A0at org.apache.directory.server.core.authn.= AuthenticationInterceptor.setAuthenticators(AuthenticationInterceptor.java:= 240)=0A =A0at org.apache.directory.server.config.builder.ServiceBuilder.cre= ateInterceptors(ServiceBuilder.java:182)=0A =A0at org.apache.directory.serv= er.config.builder.ServiceBuilder.createDirectoryService(ServiceBuilder.java= :1380)=0A =A0at org.apache.directory.server.ApacheDsService.initDirectorySe= rvice(ApacheDsService.java:300)=0A =A0at org.apache.directory.server.Apache= DsService.start(ApacheDsService.java:179)=0A =A0at org.apache.directory.ser= ver.UberjarMain.start(UberjarMain.java:76)=0A =A0at org.apache.directory.se= rver.UberjarMain.main(UberjarMain.java:54)=0A=0ALater, there is a call to D= efaultDirectoryService.initialize which calls Authenticator.init on each Au= thenticator again. However, my class does not get invoked.=0A=0AWhat happen= s is that=A0DefaultDirectoryService.initialize eventually gets to Authentic= ationInterceptor, which reads the list of authenticators from the=A0authent= icators field. This field gets populated in=A0setDefaultAuthenticators, but= does not get updated since then. In the end, even though custom authentica= tors are initialized, only the default authenticators are registered with t= he interceptor [2].=0A=0AI'm puzzled by the behavior [1] however the most c= ritical one is [2]. Because of it I can't seem to be able to have my authen= ticator get invoked during authentication.=0A=0AI've done a manual quick fi= x by adding the update of the=A0AuthenticationInterceptor.authenticators=A0= set during the=A0AuthenticationInterceptor.register method and it seems to = have fixed the issue. Not sure whether this is the right fix. May be I'm no= t configuring my authenticator correctly? The user guide does not seem to t= alk abut custom authenticators anymore...=0A=0AAuthenticationInterceptor:= =0A=0A=A0 =A0 private void register( Authenticator authenticator, Directory= Service directoryService ) throws LdapException=0A=A0 =A0 {=0A=A0 =A0 =A0 = =A0 authenticator.init( directoryService );=0A=0A=A0 =A0 =A0 =A0 Collection= authenticatorList =3D getAuthenticators( authenticator.getA= uthenticatorType() );=0A=0A=A0 =A0 =A0 =A0 if ( authenticatorList =3D=3D nu= ll )=0A=A0 =A0 =A0 =A0 {=0A=A0 =A0 =A0 =A0 =A0 =A0 authenticatorList =3D ne= w ArrayList();=0A=A0 =A0 =A0 =A0 =A0 =A0 authenticatorsMapBy= Type.put( authenticator.getAuthenticatorType(), authenticatorList );=0A=A0 = =A0 =A0 =A0 }=0A=0A=A0 =A0 =A0 =A0 authenticatorList.add( authenticator );= =0A+ =A0 =A0 =A0 =A0authenticators.add( authenticator );=0A=A0 =A0 }=0A=0AS= hould I raise a JIRA issue or could this be a configuration problem?=0A=0AT= hanks.=0A=0ADenis --1665047788-760331314-1364815072=:9686--