You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Patricio Demitrio <pd...@scoop-gmbh.de> on 2013/04/26 15:50:17 UTC

pwdHistory not validating properly (in custom server)

Hi, I'm currently working with a custom M11 server, the only thing
different is a custom implementation of AuthenticatorInterceptor.

When, from apacheDS, I try to change the user password, two different
things happen:
- If there is no pwdHistory present, the update works, and the pwdHistory
attribute is created.
- If pwdHistory exists, it throws me an error, even though the password is
completely different.

The error is:

2013.04.24 14:23:56,445 DEBUG [pool-4-thread-2]
org.apache.directory.server.core.authn.AuthenticationInterceptor [] -
Operation Context: ModifyContext for Dn 'uid=00000005,dc=2013.04.24
14:23:56,445
DEBUG [pool-4-thread-2]
org.apache.directory.server.core.authn.AuthenticationInterceptor [] -
Operation Context: ModifyContext for Dn 'uid=00000005,dc=company1,dc=com',
modifications :
Modification: replace
, attribute : userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66 0x74
0x31 '


2013.04.24 14:23:56,446 DEBUG [pool-4-thread-2]
org.apache.directory.server.ldap.handlers.LdapRequestHandler [] -
CONSTRAINT_VIOLATION: failed for MessageType : MODIFY_REQUEST
Message ID : 16
    Modify Request
        Object : 'uid=00000005,dc=company1,dc=com'
            Modification[0]
                Operation :  replace
                Modification
userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66 0x74 0x31 '
org.apache.directory.api.ldap.model.message.ModifyRequestImpl@fcebfd3b:
invalid reuse of password present in password history
org.apache.directory.api.ldap.model.exception.LdapOperationException:
invalid reuse of password present in password history
at
org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:956)
 at
app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
--->>>> extends from AuthenticationInterceptor. No added behaviour in this
example
 at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
at
org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:980)
 at
app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
 at
org.apache.directory.server.core.normalization.NormalizationInterceptor.modify(NormalizationInterceptor.java:223)
at
org.apache.directory.server.core.DefaultOperationManager.modify(DefaultOperationManager.java:782)
 at
org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:914)
at
org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:897)
 at
org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:56)
at
org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:39)
 at
org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:207)
at
org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:56)
 at
org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(DemuxingIoHandler.java:221)
at
org.apache.directory.server.ldap.LdapProtocolHandler.messageReceived(LdapProtocolHandler.java:217)
 at
org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
 at
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
 at
org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74)
at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
 at
org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.runTask(UnorderedThreadPoolExecutor.java:474)
at
org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.run(UnorderedThreadPoolExecutor.java:428)
 at java.lang.Thread.run(Thread.java:722)
2013.04.24 14:23:56,449 DEBUG [pool-4-thread-2]
org.apache.mina.core.filterchain.IoFilterEvent [] - Event MESSAGE_RECEIVED
has been fired for session 1
2013.04.24 14:23:56,449 DEBUG [NioProcessor-2]
org.apache.directory.server.ldap.handlers.LdapResponseHandler [] - Message
sent : MessageType : MODIFY_RESPONSE,dc=com', modifications :
Modification: replace
, attribute : userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66 0x74
0x31 '


2013.04.24 14:23:56,446 DEBUG [pool-4-thread-2]
org.apache.directory.server.ldap.handlers.LdapRequestHandler [] -
CONSTRAINT_VIOLATION: failed for MessageType : MODIFY_REQUEST
Message ID : 16
    Modify Request
        Object : 'uid=00000005,dc=company1,dc=com'
            Modification[0]
                Operation :  replace
                Modification
userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66 0x74 0x31 '
org.apache.directory.api.ldap.model.message.ModifyRequestImpl@fcebfd3b:
invalid reuse of password present in password history
org.apache.directory.api.ldap.model.exception.LdapOperationException:
invalid reuse of password present in password history
at
org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:956)
 at
app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
 at
org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:980)
at
app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
 at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
at
org.apache.directory.server.core.normalization.NormalizationInterceptor.modify(NormalizationInterceptor.java:223)
 at
org.apache.directory.server.core.DefaultOperationManager.modify(DefaultOperationManager.java:782)
at
org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:914)
 at
org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:897)
at
org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:56)
 at
org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:39)
at
org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:207)
 at
org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:56)
at
org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(DemuxingIoHandler.java:221)
 at
org.apache.directory.server.ldap.LdapProtocolHandler.messageReceived(LdapProtocolHandler.java:217)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690)
 at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
 at
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at
org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74)
 at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
at
org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.runTask(UnorderedThreadPoolExecutor.java:474)
 at
org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.run(UnorderedThreadPoolExecutor.java:428)
at java.lang.Thread.run(Thread.java:722)
2013.04.24 14:23:56,449 DEBUG [pool-4-thread-2]
org.apache.mina.core.filterchain.IoFilterEvent [] - Event MESSAGE_RECEIVED
has been fired for session 1
2013.04.24 14:23:56,449 DEBUG [NioProcessor-2]
org.apache.directory.server.ldap.handlers.LdapResponseHandler [] - Message
sent : MessageType : MODIFY_RESPONSE


I don't know if this helps, but here's some extra info:

Entry
    dn[n]: uid=00000005,dc=company1,dc=com
    objectclass: top
    objectclass: extensibleObject
    objectclass: InetOrgPerson
    objectclass: organizationalPerson
    objectclass: person
    objectclass: pwdPolicy
    pwdHistory: '0x32 0x30 0x31 0x33 0x30 0x34 0x32 0x34 0x31 0x32 0x32
0x33 0x32 0x39 0x2E 0x38 ...'
    pwdAllowUserChange: true
    uid: 00000005
    pwdPolicySubEntry:
ads-pwdId=default,ou=passwordPolicies,ads-interceptorId=authenticationInterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config
    pwdReset: TRUE
    userPassword: '0x70 0x61 0x73 0x73 0x77 0x6F 0x72 0x64 0x31 '
    entryParentId: ccde56b4-aa2e-4738-af71-f15648d5e563
    distinguishedName: uid=00000005,dc=company1,dc=com
    pwdChangedTime: 20130410111201.584Z
    pwdAttribute: userPassword
    givenName: Michael
    c: DE
    cn: Michael Jackson
    sn: Jackson
    l: mjackson
    mail: mjackson@company1.de
    entryuuid: f679c2bb-e2f4-4987-8533-4d0b8407e876
    o: Test Company
    entryDN: uid=00000005,dc=company1,dc=com
    modifyTimestamp: 20130424122329.889Z
    entryCSN: 20130424122329.889000Z#000000#000#000000
    displayName: Michael Jackson
    modifiersName: 0.9.2342.19200300.100.1.1=admin,2.5.4.11=system


dn:
ads-pwdId=default,ou=passwordPolicies,ads-interceptorId=authenticationInterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config
objectClass: top
objectClass: ads-base
objectClass: ads-passwordPolicy
ads-pwdId: default
ads-pwdSafeModify: FALSE
ads-pwdMaxAge: 0
ads-pwdFailureCountInterval: 30
ads-pwdAttribute: userPassword
ads-pwdMaxFailure: 5
ads-pwdLockout: TRUE
ads-pwdMustChange: FALSE
ads-pwdLockoutDuration: 0
ads-pwdMinLength: 5
ads-pwdInHistory: 5
ads-pwdExpireWarning: 0
ads-pwdMinAge: 0
ads-pwdAllowUserChange: TRUE
ads-pwdGraceAuthNLimit: 0
ads-pwdCheckQuality: 2
ads-pwdMaxLength: 0
ads-pwdGraceExpire: 0
ads-pwdMinDelay: 0
ads-pwdMaxDelay: 0
ads-pwdMaxIdle: 0
ads-enabled: TRUE

Re: pwdHistory not validating properly (in custom server)

Posted by Patricio Demitrio <pd...@scoop-gmbh.de>.
My specific problem is at the beginning of modify(), on the if instance:

 if ( !directoryService.isPwdPolicyEnabled() || modifyContext.isReplEvent()
)
        {
            next( modifyContext );
            invalidateAuthenticatorCaches( modifyContext.getDn() );
            return;
        }


I printed both directoryService.isPwdPolicyEnabled() and
 modifyContext.isReplEvent(), and both are set to false.
If I extend it from AuthenticationInterceptor,
directoryService.isPwdPolicyEnabled() is true.


On Thu, May 2, 2013 at 12:30 PM, Patricio Demitrio
<pd...@scoop-gmbh.de>wrote:

> Hi again,
>
> Apparently I'm having the same error as before. And when debugging, I
> still see the AuthenticationInterceptor two times.
>
> Now I'm trying to extend AuthenticationInterceptor2 directly from
> BaseInterceptor.. with some problems =). I'll keep you updated.
>
>
> On Thu, May 2, 2013 at 9:27 AM, Emmanuel Lécharny <el...@gmail.com>wrote:
>
>> Le 5/2/13 9:21 AM, Patricio Demitrio a écrit :
>> > Thanks so much for your feedback. I'll work on this today and let you
>> know.
>> > Also, thank you for creating the jira ticket for me
>>
>> Test the newly built server, you can download it on
>> people.apache.org/~elecharny
>>
>>
>> --
>> Regards,
>> Cordialement,
>> Emmanuel Lécharny
>> www.iktek.com
>>
>>
>

Re: pwdHistory not validating properly (in custom server)

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/2/13 3:27 PM, Patricio Demitrio a écrit :
> Hi again,
>
> it's working now, as far as I can tell. I did all my typical tests and the
> new passwords went through.
>
> Many many thanks for your constant support.

You're welcome !


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: pwdHistory not validating properly (in custom server)

Posted by Patricio Demitrio <pd...@scoop-gmbh.de>.
Hi again,

it's working now, as far as I can tell. I did all my typical tests and the
new passwords went through.

Many many thanks for your constant support.

Regards,
Patricio


On Thu, May 2, 2013 at 1:31 PM, Emmanuel Lécharny <el...@gmail.com>wrote:

> Le 5/2/13 1:21 PM, Patricio Demitrio a écrit :
> > I'm working on Linux (debian) but actually I'm adding the service jar to
> my
> > project.
>
> Build the jars from trunk, that should solve your issue.
> (http://directory.apache.org/apacheds/advanced-ug/0.2-building-trunks.html
> )
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Re: pwdHistory not validating properly (in custom server)

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/2/13 1:21 PM, Patricio Demitrio a écrit :
> I'm working on Linux (debian) but actually I'm adding the service jar to my
> project.

Build the jars from trunk, that should solve your issue.
(http://directory.apache.org/apacheds/advanced-ug/0.2-building-trunks.html)

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: pwdHistory not validating properly (in custom server)

Posted by Patricio Demitrio <pd...@scoop-gmbh.de>.
I'm working on Linux (debian) but actually I'm adding the service jar to my
project.


On Thu, May 2, 2013 at 1:19 PM, Emmanuel Lécharny <el...@gmail.com>wrote:

> Le 5/2/13 1:10 PM, Patricio Demitrio a écrit :
> > Do you know for when it is scheduled?
> No, but you can build an installer for your platform from trunk.
>
> What is your platform ?
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Re: pwdHistory not validating properly (in custom server)

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/2/13 1:10 PM, Patricio Demitrio a écrit :
> Do you know for when it is scheduled?
No, but you can build an installer for your platform from trunk.

What is your platform ?


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: pwdHistory not validating properly (in custom server)

Posted by Patricio Demitrio <pd...@scoop-gmbh.de>.
Do you know for when it is scheduled?

Thanks


On Thu, May 2, 2013 at 12:49 PM, Emmanuel Lécharny <el...@gmail.com>wrote:

> Le 5/2/13 12:30 PM, Patricio Demitrio a écrit :
> > Hi again,
> >
> > Apparently I'm having the same error as before. And when debugging, I
> still
> > see the AuthenticationInterceptor two times.
>
> My bad. I thought the fix was injected in M12, but no, I did it on trunk
> after the release...
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Re: pwdHistory not validating properly (in custom server)

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/2/13 12:30 PM, Patricio Demitrio a écrit :
> Hi again,
>
> Apparently I'm having the same error as before. And when debugging, I still
> see the AuthenticationInterceptor two times.

My bad. I thought the fix was injected in M12, but no, I did it on trunk
after the release...


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: pwdHistory not validating properly (in custom server)

Posted by Patricio Demitrio <pd...@scoop-gmbh.de>.
Hi again,

Apparently I'm having the same error as before. And when debugging, I still
see the AuthenticationInterceptor two times.

Now I'm trying to extend AuthenticationInterceptor2 directly from
BaseInterceptor.. with some problems =). I'll keep you updated.


On Thu, May 2, 2013 at 9:27 AM, Emmanuel Lécharny <el...@gmail.com>wrote:

> Le 5/2/13 9:21 AM, Patricio Demitrio a écrit :
> > Thanks so much for your feedback. I'll work on this today and let you
> know.
> > Also, thank you for creating the jira ticket for me
>
> Test the newly built server, you can download it on
> people.apache.org/~elecharny
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Re: pwdHistory not validating properly (in custom server)

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/2/13 9:21 AM, Patricio Demitrio a écrit :
> Thanks so much for your feedback. I'll work on this today and let you know.
> Also, thank you for creating the jira ticket for me

Test the newly built server, you can download it on
people.apache.org/~elecharny


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: pwdHistory not validating properly (in custom server)

Posted by Patricio Demitrio <pd...@scoop-gmbh.de>.
Thanks so much for your feedback. I'll work on this today and let you know.
Also, thank you for creating the jira ticket for me


On Tue, Apr 30, 2013 at 7:13 PM, Emmanuel Lécharny <el...@gmail.com>wrote:

> Le 4/30/13 7:10 PM, Emmanuel Lécharny a écrit :
> > I have committed a change in trunk :
> >
> > http://svn.apache.org/r1477725
> >
> > That should solve your issue.
>
> And here is the associated JIRA :
> https://issues.apache.org/jira/browse/DIRSERVER-1836
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Re: pwdHistory not validating properly (in custom server)

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 4/30/13 7:10 PM, Emmanuel Lécharny a écrit :
> I have committed a change in trunk :
>
> http://svn.apache.org/r1477725
>
> That should solve your issue.

And here is the associated JIRA :
https://issues.apache.org/jira/browse/DIRSERVER-1836


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: pwdHistory not validating properly (in custom server)

Posted by Emmanuel Lécharny <el...@gmail.com>.
I have committed a change in trunk :

http://svn.apache.org/r1477725

That should solve your issue.

Can you tell me if it does ? Thanks !


Le 4/30/13 6:32 PM, Emmanuel Lécharny a écrit :
> Le 4/30/13 6:04 PM, Emmanuel Lécharny a écrit :
>> Le 4/30/13 6:03 PM, Emmanuel Lécharny a écrit :
>>> Le 4/30/13 6:02 PM, Emmanuel Lécharny a écrit :
>>>> Le 4/30/13 5:37 PM, Patricio Demitrio a écrit :
>>>>> Please try something if you have a couple of minutes.
>>>>>
>>>>> Grab the code from AuthenticationInterceptor.java, create a new class, for
>>>>> example, AuthenticationInterceptor2.java, and copy it.
>>>>>
>>>>> Changes needed in order to compile:
>>>>> import AuthenticationInterceptor
>>>>> change "extends Base..." for "extends AuthenticatorInterceptor"
>>>>> fix the super call in the constructor.
>>>>>
>>>>> If I'm not wrong, that should compile for you. Now, instead of including
>>>>> AuthenticationInterceptor in your DirectoryService, please include
>>>>> AuthenticationInterceptor2.
>>>>>
>>>>> That should start your server normally. And that should give you the error.
>>>> Doing that atm...
>>>>
>>>> I will run the pwdPolicyTests to see what's going on;
>>>>
>>>>
>>> Hmmm, seems to blow pretty well :-)
>> S/blow/blow out/
>>
>>
> Ok, I know what's going on.
>
> The way the server initialization works, the result ou get is plain
> normal. Let me explain what's going on.
>
> When a request is received, we will pass it through the interceptor
> chain. Let's say it's an ADD operation.
>
> So we will process this operation through each interceptor add() method,
> assuming the interceptor implements the add() method.
>
> How do we know that the interceptor implements the add() operation ?
> Easy : we use reflection. We do that for each interceptor.
>
> For performance reason, we pre-parse all the interceptors at startup to
> know which intecreptor to activate when the server is up and running,
> instead of cimputing this for every single request.
>
> For the ADD operation, we generate this list :
>
> {ADD=[normalizationInterceptor, **authenticationInterceptor**,
> **authenticationInterceptor**, referralInterceptor,
> aciAuthorizationInterceptor, administrativePointInterceptor,
> exceptionInterceptor, schemaInterceptor,
> operationalAttributeInterceptor, collectiveAttributeInterceptor,
> subentryInterceptor, eventInterceptor, triggerInterceptor,
> changeLogInterceptor, journalInterceptor]}
>
> As you can see, the authenticationInterceptor is present *twice* in this
> list. Why ? Just because we will find the add() method in the
> AuthenticatonIntecreptor2 class, *and* in its parent, so both classes
> will be added, using the name of the parent.
>
> The result is that you will pass twice in the interceptor, and of
> course, the second time, the password will already be present in the
> pwdHistory variable...
>
> The code that does this is in DefaultDirectoryService :
>
>     private void gatherInterceptors( Interceptor interceptor, Class<?>
> interceptorClz, OperationEnum operation,
>         List<String> selectedInterceptorList )
>     {
>             ...
>             if ( hasCorrestSig && method.getName().equals(
> operation.getMethodName() ) )
>             {
>                 selectedInterceptorList.add( interceptor.getName() );
>
>                 break;
>             }
>         }
>
>         gatherInterceptors( interceptor, interceptorClz.getSuperclass(),
> operation, selectedInterceptorList ); <<<<---------------- Here...
>     }
>
> If I modify this method to have this instead :
>
>     private void gatherInterceptors( Interceptor interceptor, Class<?>
> interceptorClz, OperationEnum operation,
>         List<String> selectedInterceptorList )
>     {
>             ...
>             if ( hasCorrestSig && method.getName().equals(
> operation.getMethodName() ) )
>             {
>                 if ( !selectedInterceptorList.contains(
> interceptor.getName() ) )
>                 {
>                     selectedInterceptorList.add( interceptor.getName() );
>                 }
>         }
>
>         gatherInterceptors( interceptor, interceptorClz.getSuperclass(),
> operation, selectedInterceptorList ); <<<<---------------- Here...
>     }
>
> magically, the test works.
>
>
> Now, the question is why would you extend the AuthenticatorIntecreptor,
> instead of writing your own ? Is it mandatory ?
>
> In any case, I think I can change the code so that the interceptors does
> not appears twice in the list. I'm currently running integration tests
> to see if it has any impact on the code (I don't think so).
>
> I'd like you to create a JIRA where you expose the pb, so that we can
> track it.
>
> This was an interesting issue :) Thanks a lot for your patience !
>


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: pwdHistory not validating properly (in custom server)

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 4/30/13 6:04 PM, Emmanuel Lécharny a écrit :
> Le 4/30/13 6:03 PM, Emmanuel Lécharny a écrit :
>> Le 4/30/13 6:02 PM, Emmanuel Lécharny a écrit :
>>> Le 4/30/13 5:37 PM, Patricio Demitrio a écrit :
>>>> Please try something if you have a couple of minutes.
>>>>
>>>> Grab the code from AuthenticationInterceptor.java, create a new class, for
>>>> example, AuthenticationInterceptor2.java, and copy it.
>>>>
>>>> Changes needed in order to compile:
>>>> import AuthenticationInterceptor
>>>> change "extends Base..." for "extends AuthenticatorInterceptor"
>>>> fix the super call in the constructor.
>>>>
>>>> If I'm not wrong, that should compile for you. Now, instead of including
>>>> AuthenticationInterceptor in your DirectoryService, please include
>>>> AuthenticationInterceptor2.
>>>>
>>>> That should start your server normally. And that should give you the error.
>>> Doing that atm...
>>>
>>> I will run the pwdPolicyTests to see what's going on;
>>>
>>>
>> Hmmm, seems to blow pretty well :-)
> S/blow/blow out/
>
>
Ok, I know what's going on.

The way the server initialization works, the result ou get is plain
normal. Let me explain what's going on.

When a request is received, we will pass it through the interceptor
chain. Let's say it's an ADD operation.

So we will process this operation through each interceptor add() method,
assuming the interceptor implements the add() method.

How do we know that the interceptor implements the add() operation ?
Easy : we use reflection. We do that for each interceptor.

For performance reason, we pre-parse all the interceptors at startup to
know which intecreptor to activate when the server is up and running,
instead of cimputing this for every single request.

For the ADD operation, we generate this list :

{ADD=[normalizationInterceptor, **authenticationInterceptor**,
**authenticationInterceptor**, referralInterceptor,
aciAuthorizationInterceptor, administrativePointInterceptor,
exceptionInterceptor, schemaInterceptor,
operationalAttributeInterceptor, collectiveAttributeInterceptor,
subentryInterceptor, eventInterceptor, triggerInterceptor,
changeLogInterceptor, journalInterceptor]}

As you can see, the authenticationInterceptor is present *twice* in this
list. Why ? Just because we will find the add() method in the
AuthenticatonIntecreptor2 class, *and* in its parent, so both classes
will be added, using the name of the parent.

The result is that you will pass twice in the interceptor, and of
course, the second time, the password will already be present in the
pwdHistory variable...

The code that does this is in DefaultDirectoryService :

    private void gatherInterceptors( Interceptor interceptor, Class<?>
interceptorClz, OperationEnum operation,
        List<String> selectedInterceptorList )
    {
            ...
            if ( hasCorrestSig && method.getName().equals(
operation.getMethodName() ) )
            {
                selectedInterceptorList.add( interceptor.getName() );

                break;
            }
        }

        gatherInterceptors( interceptor, interceptorClz.getSuperclass(),
operation, selectedInterceptorList ); <<<<---------------- Here...
    }

If I modify this method to have this instead :

    private void gatherInterceptors( Interceptor interceptor, Class<?>
interceptorClz, OperationEnum operation,
        List<String> selectedInterceptorList )
    {
            ...
            if ( hasCorrestSig && method.getName().equals(
operation.getMethodName() ) )
            {
                if ( !selectedInterceptorList.contains(
interceptor.getName() ) )
                {
                    selectedInterceptorList.add( interceptor.getName() );
                }
        }

        gatherInterceptors( interceptor, interceptorClz.getSuperclass(),
operation, selectedInterceptorList ); <<<<---------------- Here...
    }

magically, the test works.


Now, the question is why would you extend the AuthenticatorIntecreptor,
instead of writing your own ? Is it mandatory ?

In any case, I think I can change the code so that the interceptors does
not appears twice in the list. I'm currently running integration tests
to see if it has any impact on the code (I don't think so).

I'd like you to create a JIRA where you expose the pb, so that we can
track it.

This was an interesting issue :) Thanks a lot for your patience !

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: pwdHistory not validating properly (in custom server)

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 4/30/13 6:03 PM, Emmanuel Lécharny a écrit :
> Le 4/30/13 6:02 PM, Emmanuel Lécharny a écrit :
>> Le 4/30/13 5:37 PM, Patricio Demitrio a écrit :
>>> Please try something if you have a couple of minutes.
>>>
>>> Grab the code from AuthenticationInterceptor.java, create a new class, for
>>> example, AuthenticationInterceptor2.java, and copy it.
>>>
>>> Changes needed in order to compile:
>>> import AuthenticationInterceptor
>>> change "extends Base..." for "extends AuthenticatorInterceptor"
>>> fix the super call in the constructor.
>>>
>>> If I'm not wrong, that should compile for you. Now, instead of including
>>> AuthenticationInterceptor in your DirectoryService, please include
>>> AuthenticationInterceptor2.
>>>
>>> That should start your server normally. And that should give you the error.
>> Doing that atm...
>>
>> I will run the pwdPolicyTests to see what's going on;
>>
>>
> Hmmm, seems to blow pretty well :-)

S/blow/blow out/


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: pwdHistory not validating properly (in custom server)

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 4/30/13 6:02 PM, Emmanuel Lécharny a écrit :
> Le 4/30/13 5:37 PM, Patricio Demitrio a écrit :
>> Please try something if you have a couple of minutes.
>>
>> Grab the code from AuthenticationInterceptor.java, create a new class, for
>> example, AuthenticationInterceptor2.java, and copy it.
>>
>> Changes needed in order to compile:
>> import AuthenticationInterceptor
>> change "extends Base..." for "extends AuthenticatorInterceptor"
>> fix the super call in the constructor.
>>
>> If I'm not wrong, that should compile for you. Now, instead of including
>> AuthenticationInterceptor in your DirectoryService, please include
>> AuthenticationInterceptor2.
>>
>> That should start your server normally. And that should give you the error.
> Doing that atm...
>
> I will run the pwdPolicyTests to see what's going on;
>
>
Hmmm, seems to blow pretty well :-)

Ok, debugging now...

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: pwdHistory not validating properly (in custom server)

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 4/30/13 5:37 PM, Patricio Demitrio a écrit :
> Please try something if you have a couple of minutes.
>
> Grab the code from AuthenticationInterceptor.java, create a new class, for
> example, AuthenticationInterceptor2.java, and copy it.
>
> Changes needed in order to compile:
> import AuthenticationInterceptor
> change "extends Base..." for "extends AuthenticatorInterceptor"
> fix the super call in the constructor.
>
> If I'm not wrong, that should compile for you. Now, instead of including
> AuthenticationInterceptor in your DirectoryService, please include
> AuthenticationInterceptor2.
>
> That should start your server normally. And that should give you the error.

Doing that atm...

I will run the pwdPolicyTests to see what's going on;


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: pwdHistory not validating properly (in custom server)

Posted by Patricio Demitrio <pd...@scoop-gmbh.de>.
Please try something if you have a couple of minutes.

Grab the code from AuthenticationInterceptor.java, create a new class, for
example, AuthenticationInterceptor2.java, and copy it.

Changes needed in order to compile:
import AuthenticationInterceptor
change "extends Base..." for "extends AuthenticatorInterceptor"
fix the super call in the constructor.

If I'm not wrong, that should compile for you. Now, instead of including
AuthenticationInterceptor in your DirectoryService, please include
AuthenticationInterceptor2.

That should start your server normally. And that should give you the error.

Another example for forcing the error: the class
AuthenticationInterceptor2, instead of being a duplicate
of AuthenticationInterceptor, is created with only this:

import org.apache.directory.api.ldap.model.exception.LdapException;
import
org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext;
import org.apache.directory.server.core.authn.AuthenticationInterceptor;

public class AuthenticationInterceptor2 extends AuthenticationInterceptor{

public void modify( ModifyOperationContext modifyContext ) throws
LdapException
    {
super.modify(modifyContext);
    }
}

Re: pwdHistory not validating properly (in custom server)

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 4/30/13 2:54 PM, Patricio Demitrio a écrit :
> I will check that code now. In the meantime here's the stacktrace. 

Looking at the first stackTrace you provided :

invalid reuse of password present in password history
at
org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:956)

...

The code is :

                    for ( Value<?> value : pwdHistoryAt )
                    {
                        PasswordHistory pwdh = new PasswordHistory( Strings.utf8ToString( value.getBytes() ) );

                        boolean matched = Arrays.equals( newPassword, pwdh.getPassword() );

                        if ( matched )
                        {
                            if ( isPPolicyReqCtrlPresent )
                            {
                                PasswordPolicyDecorator responseControl =
                                    new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true );
                                responseControl.getResponse().setPasswordPolicyError(
                                    PasswordPolicyErrorEnum.PASSWORD_IN_HISTORY );
                                modifyContext.addResponseControl( responseControl );
                            }

                            throw new LdapOperationException( ResultCodeEnum.CONSTRAINT_VIOLATION,
                                "invalid reuse of password present in password history" );
                        }


and you get an exception because the password you are providing is already present in the passwordHistory (which may store many different password).

What the code does is quite simple :
- we grab the 'pwdHistory' AttributeType of the entry
- we iterate on all its values
- if one of them is equal to the new password, then we throw an exception

So either you set the new password in the entry *before* this test is
done (and as it's a new password, it will also be present in the
pwdHistory AT), or you are trying to set a password that has already
been set.

I think your problem is that you do the check too late.

Can you provide the code of your interceptor ?


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: pwdHistory not validating properly (in custom server)

Posted by Patricio Demitrio <pd...@scoop-gmbh.de>.
I will check that code now. In the meantime here's the stacktrace. I'm
underlining the call metioned in my previous mail

Thread [pool-4-thread-1] (Suspended (breakpoint at line 385 in
AuthenticationInterceptor2))
AuthenticationInterceptor2.modify(ModifyOperationContext) line: 385
* AuthenticationInterceptor2(BaseInterceptor).next(ModifyOperationContext)
line: 577 *
AuthenticationInterceptor2.modify(ModifyOperationContext) line: 426
NormalizationInterceptor(BaseInterceptor).next(ModifyOperationContext)
line: 577
NormalizationInterceptor.modify(ModifyOperationContext) line: 223
DefaultOperationManager.modify(ModifyOperationContext) line: 782
DefaultCoreSession.modify(ModifyRequest, LogChange) line: 914
DefaultCoreSession.modify(ModifyRequest) line: 897
ModifyRequestHandler.handle(LdapSession, ModifyRequest) line: 56
ModifyRequestHandler.handle(LdapSession, Request) line: 39
ModifyRequestHandler(LdapRequestHandler<T>).handleMessage(IoSession, T)
line: 207
ModifyRequestHandler(LdapRequestHandler<T>).handleMessage(IoSession,
Object) line: 56
LdapProtocolHandler(DemuxingIoHandler).messageReceived(IoSession, Object)
line: 221
LdapProtocolHandler.messageReceived(IoSession, Object) line: 217
DefaultIoFilterChain$TailFilter.messageReceived(IoFilter$NextFilter,
IoSession, Object) line: 690
DefaultIoFilterChain.callNextMessageReceived(IoFilterChain$Entry,
IoSession, Object) line: 417
DefaultIoFilterChain.access$1200(DefaultIoFilterChain, IoFilterChain$Entry,
IoSession, Object) line: 47
DefaultIoFilterChain$EntryImpl$1.messageReceived(IoSession, Object) line:
765
IoFilterEvent.fire() line: 74
IoFilterEvent(IoEvent).run() line: 63
UnorderedThreadPoolExecutor$Worker.runTask(Runnable) line: 474
UnorderedThreadPoolExecutor$Worker.run() line: 428
Thread.run() line: not available



On Tue, Apr 30, 2013 at 2:26 PM, Emmanuel Lécharny <el...@gmail.com>wrote:

> Le 4/30/13 2:21 PM, Patricio Demitrio a écrit :
> > Hi all,
> >
> > I'm still working on this issue, and maybe is related on how
> > I'm instantiating the interceptor.
> >
> > I attached a picture of the debugging procedure. Note that base
> > interceptor, after calling next(), is reaching AuthenticatorInterceptor
> > again.
>
> Sadly, the picture didn't make it through the mail server :/
>
> I would suggest you create a JIRA and attach the picture to it.
>
> Otherwise, we are just releasing a new version (M12) which is currently
> being voted, and it might be worthlful to check your code against this
> new version. The sources and binaries are available on
> people.apache.org/~elecharny, or you can checkout the sources from
> http://svn.apache.org/repos/asf/directory/apacheds/tags/2.0.0-M12
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Re: pwdHistory not validating properly (in custom server)

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 4/30/13 2:21 PM, Patricio Demitrio a écrit :
> Hi all,
>
> I'm still working on this issue, and maybe is related on how
> I'm instantiating the interceptor.
>
> I attached a picture of the debugging procedure. Note that base
> interceptor, after calling next(), is reaching AuthenticatorInterceptor
> again.

Sadly, the picture didn't make it through the mail server :/

I would suggest you create a JIRA and attach the picture to it.

Otherwise, we are just releasing a new version (M12) which is currently
being voted, and it might be worthlful to check your code against this
new version. The sources and binaries are available on
people.apache.org/~elecharny, or you can checkout the sources from
http://svn.apache.org/repos/asf/directory/apacheds/tags/2.0.0-M12


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: pwdHistory not validating properly (in custom server)

Posted by Patricio Demitrio <pd...@scoop-gmbh.de>.
Hi all,

I'm still working on this issue, and maybe is related on how
I'm instantiating the interceptor.

I attached a picture of the debugging procedure. Note that base
interceptor, after calling next(), is reaching AuthenticatorInterceptor
again.

Is this correct?

Thanks for the feedback.

Re: pwdHistory not validating properly (in custom server)

Posted by Kiran Ayyagari <ka...@apache.org>.
I have tested with M11 and couldn't reproduce the reported password history
error (entered different passwords)


On Fri, Apr 26, 2013 at 7:54 PM, Patricio Demitrio
<pd...@scoop-gmbh.de>wrote:

> Im pretty sure, yes.
> When debugging, my interceptors listed are:
>
> [org.apache.directory.server.core.normalization.NormalizationInterceptor@4f8771a
> ,
> app.ldap.server.AuthenticationInterceptor2@54534e82,
> org.apache.directory.server.core.referral.ReferralInterceptor@2947640e,
> org.apache.directory.server.core.authz.AciAuthorizationInterceptor@df9e84e
> ,
>
> org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor@1202600d
> ,
>
> org.apache.directory.server.core.admin.AdministrativePointInterceptor@59effeb7
> ,
> org.apache.directory.server.core.exception.ExceptionInterceptor@1b3bce82,
> org.apache.directory.server.core.schema.SchemaInterceptor@7372c6c5,
>
> org.apache.directory.server.core.operational.OperationalAttributeInterceptor@7457eab9
> ,
>
> org.apache.directory.server.core.collective.CollectiveAttributeInterceptor@37f3535b
> ,
> org.apache.directory.server.core.subtree.SubentryInterceptor@47e5980f,
>  org.apache.directory.server.core.event.EventInterceptor@326225a9,
> org.apache.directory.server.core.trigger.TriggerInterceptor@49969416,
> org.apache.directory.server.core.changelog.ChangeLogInterceptor@3cd45618,
> org.apache.directory.server.core.journal.JournalInterceptor@186060db]
>
>
> ABout the canges you mentioned, is there something newer than M11? Or
> should I build something locally?
>
> Thanks
>
>
> On Fri, Apr 26, 2013 at 4:17 PM, Kiran Ayyagari <kayyagari@apache.org
> >wrote:
>
> > did you disable the default AuthenticationInterceptor?
> >
> >
> > On Fri, Apr 26, 2013 at 7:20 PM, Patricio Demitrio
> > <pd...@scoop-gmbh.de>wrote:
> >
> > > Hi, I'm currently working with a custom M11 server, the only thing
> > > different is a custom implementation of AuthenticatorInterceptor.
> > >
> > > When, from apacheDS, I try to change the user password, two different
> > > things happen:
> > > - If there is no pwdHistory present, the update works, and the
> pwdHistory
> > > attribute is created.
> > > - If pwdHistory exists, it throws me an error, even though the password
> > is
> > > completely different.
> > >
> > > The error is:
> > >
> > > 2013.04.24 14:23:56,445 DEBUG [pool-4-thread-2]
> > > org.apache.directory.server.core.authn.AuthenticationInterceptor [] -
> > > Operation Context: ModifyContext for Dn 'uid=00000005,dc=2013.04.24
> > > 14:23:56,445
> > > DEBUG [pool-4-thread-2]
> > > org.apache.directory.server.core.authn.AuthenticationInterceptor [] -
> > > Operation Context: ModifyContext for Dn
> > 'uid=00000005,dc=company1,dc=com',
> > > modifications :
> > > Modification: replace
> > > , attribute : userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66
> 0x74
> > > 0x31 '
> > >
> > >
> > > 2013.04.24 14:23:56,446 DEBUG [pool-4-thread-2]
> > > org.apache.directory.server.ldap.handlers.LdapRequestHandler [] -
> > > CONSTRAINT_VIOLATION: failed for MessageType : MODIFY_REQUEST
> > > Message ID : 16
> > >     Modify Request
> > >         Object : 'uid=00000005,dc=company1,dc=com'
> > >             Modification[0]
> > >                 Operation :  replace
> > >                 Modification
> > > userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66 0x74 0x31 '
> > > org.apache.directory.api.ldap.model.message.ModifyRequestImpl@fcebfd3b
> :
> > > invalid reuse of password present in password history
> > > org.apache.directory.api.ldap.model.exception.LdapOperationException:
> > > invalid reuse of password present in password history
> > > at
> > >
> > >
> >
> org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:956)
> > >  at
> > >
> > >
> >
> app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
> > > --->>>> extends from AuthenticationInterceptor. No added behaviour in
> > this
> > > example
> > >  at
> > >
> > >
> >
> org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
> > > at
> > >
> > >
> >
> org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:980)
> > >  at
> > >
> > >
> >
> app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
> > > at
> > >
> > >
> >
> org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
> > >  at
> > >
> > >
> >
> org.apache.directory.server.core.normalization.NormalizationInterceptor.modify(NormalizationInterceptor.java:223)
> > > at
> > >
> > >
> >
> org.apache.directory.server.core.DefaultOperationManager.modify(DefaultOperationManager.java:782)
> > >  at
> > >
> > >
> >
> org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:914)
> > > at
> > >
> > >
> >
> org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:897)
> > >  at
> > >
> > >
> >
> org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:56)
> > > at
> > >
> > >
> >
> org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:39)
> > >  at
> > >
> > >
> >
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:207)
> > > at
> > >
> > >
> >
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:56)
> > >  at
> > >
> > >
> >
> org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(DemuxingIoHandler.java:221)
> > > at
> > >
> > >
> >
> org.apache.directory.server.ldap.LdapProtocolHandler.messageReceived(LdapProtocolHandler.java:217)
> > >  at
> > >
> > >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690)
> > > at
> > >
> > >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
> > >  at
> > >
> > >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
> > > at
> > >
> > >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
> > >  at
> > >
> >
> org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74)
> > > at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
> > >  at
> > >
> > >
> >
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.runTask(UnorderedThreadPoolExecutor.java:474)
> > > at
> > >
> > >
> >
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.run(UnorderedThreadPoolExecutor.java:428)
> > >  at java.lang.Thread.run(Thread.java:722)
> > > 2013.04.24 14:23:56,449 DEBUG [pool-4-thread-2]
> > > org.apache.mina.core.filterchain.IoFilterEvent [] - Event
> > MESSAGE_RECEIVED
> > > has been fired for session 1
> > > 2013.04.24 14:23:56,449 DEBUG [NioProcessor-2]
> > > org.apache.directory.server.ldap.handlers.LdapResponseHandler [] -
> > Message
> > > sent : MessageType : MODIFY_RESPONSE,dc=com', modifications :
> > > Modification: replace
> > > , attribute : userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66
> 0x74
> > > 0x31 '
> > >
> > >
> > > 2013.04.24 14:23:56,446 DEBUG [pool-4-thread-2]
> > > org.apache.directory.server.ldap.handlers.LdapRequestHandler [] -
> > > CONSTRAINT_VIOLATION: failed for MessageType : MODIFY_REQUEST
> > > Message ID : 16
> > >     Modify Request
> > >         Object : 'uid=00000005,dc=company1,dc=com'
> > >             Modification[0]
> > >                 Operation :  replace
> > >                 Modification
> > > userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66 0x74 0x31 '
> > > org.apache.directory.api.ldap.model.message.ModifyRequestImpl@fcebfd3b
> :
> > > invalid reuse of password present in password history
> > > org.apache.directory.api.ldap.model.exception.LdapOperationException:
> > > invalid reuse of password present in password history
> > > at
> > >
> > >
> >
> org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:956)
> > >  at
> > >
> > >
> >
> app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
> > > at
> > >
> > >
> >
> org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
> > >  at
> > >
> > >
> >
> org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:980)
> > > at
> > >
> > >
> >
> app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
> > >  at
> > >
> > >
> >
> org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
> > > at
> > >
> > >
> >
> org.apache.directory.server.core.normalization.NormalizationInterceptor.modify(NormalizationInterceptor.java:223)
> > >  at
> > >
> > >
> >
> org.apache.directory.server.core.DefaultOperationManager.modify(DefaultOperationManager.java:782)
> > > at
> > >
> > >
> >
> org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:914)
> > >  at
> > >
> > >
> >
> org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:897)
> > > at
> > >
> > >
> >
> org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:56)
> > >  at
> > >
> > >
> >
> org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:39)
> > > at
> > >
> > >
> >
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:207)
> > >  at
> > >
> > >
> >
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:56)
> > > at
> > >
> > >
> >
> org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(DemuxingIoHandler.java:221)
> > >  at
> > >
> > >
> >
> org.apache.directory.server.ldap.LdapProtocolHandler.messageReceived(LdapProtocolHandler.java:217)
> > > at
> > >
> > >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690)
> > >  at
> > >
> > >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
> > > at
> > >
> > >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
> > >  at
> > >
> > >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
> > > at
> > >
> >
> org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74)
> > >  at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
> > > at
> > >
> > >
> >
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.runTask(UnorderedThreadPoolExecutor.java:474)
> > >  at
> > >
> > >
> >
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.run(UnorderedThreadPoolExecutor.java:428)
> > > at java.lang.Thread.run(Thread.java:722)
> > > 2013.04.24 14:23:56,449 DEBUG [pool-4-thread-2]
> > > org.apache.mina.core.filterchain.IoFilterEvent [] - Event
> > MESSAGE_RECEIVED
> > > has been fired for session 1
> > > 2013.04.24 14:23:56,449 DEBUG [NioProcessor-2]
> > > org.apache.directory.server.ldap.handlers.LdapResponseHandler [] -
> > Message
> > > sent : MessageType : MODIFY_RESPONSE
> > >
> > >
> > > I don't know if this helps, but here's some extra info:
> > >
> > > Entry
> > >     dn[n]: uid=00000005,dc=company1,dc=com
> > >     objectclass: top
> > >     objectclass: extensibleObject
> > >     objectclass: InetOrgPerson
> > >     objectclass: organizationalPerson
> > >     objectclass: person
> > >     objectclass: pwdPolicy
> > >     pwdHistory: '0x32 0x30 0x31 0x33 0x30 0x34 0x32 0x34 0x31 0x32 0x32
> > > 0x33 0x32 0x39 0x2E 0x38 ...'
> > >     pwdAllowUserChange: true
> > >     uid: 00000005
> > >     pwdPolicySubEntry:
> > >
> > >
> >
> ads-pwdId=default,ou=passwordPolicies,ads-interceptorId=authenticationInterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config
> > >     pwdReset: TRUE
> > >     userPassword: '0x70 0x61 0x73 0x73 0x77 0x6F 0x72 0x64 0x31 '
> > >     entryParentId: ccde56b4-aa2e-4738-af71-f15648d5e563
> > >     distinguishedName: uid=00000005,dc=company1,dc=com
> > >     pwdChangedTime: 20130410111201.584Z
> > >     pwdAttribute: userPassword
> > >     givenName: Michael
> > >     c: DE
> > >     cn: Michael Jackson
> > >     sn: Jackson
> > >     l: mjackson
> > >     mail: mjackson@company1.de
> > >     entryuuid: f679c2bb-e2f4-4987-8533-4d0b8407e876
> > >     o: Test Company
> > >     entryDN: uid=00000005,dc=company1,dc=com
> > >     modifyTimestamp: 20130424122329.889Z
> > >     entryCSN: 20130424122329.889000Z#000000#000#000000
> > >     displayName: Michael Jackson
> > >     modifiersName: 0.9.2342.19200300.100.1.1=admin,2.5.4.11=system
> > >
> > >
> > > dn:
> > >
> > >
> >
> ads-pwdId=default,ou=passwordPolicies,ads-interceptorId=authenticationInterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config
> > > objectClass: top
> > > objectClass: ads-base
> > > objectClass: ads-passwordPolicy
> > > ads-pwdId: default
> > > ads-pwdSafeModify: FALSE
> > > ads-pwdMaxAge: 0
> > > ads-pwdFailureCountInterval: 30
> > > ads-pwdAttribute: userPassword
> > > ads-pwdMaxFailure: 5
> > > ads-pwdLockout: TRUE
> > > ads-pwdMustChange: FALSE
> > > ads-pwdLockoutDuration: 0
> > > ads-pwdMinLength: 5
> > > ads-pwdInHistory: 5
> > > ads-pwdExpireWarning: 0
> > > ads-pwdMinAge: 0
> > > ads-pwdAllowUserChange: TRUE
> > > ads-pwdGraceAuthNLimit: 0
> > > ads-pwdCheckQuality: 2
> > > ads-pwdMaxLength: 0
> > > ads-pwdGraceExpire: 0
> > > ads-pwdMinDelay: 0
> > > ads-pwdMaxDelay: 0
> > > ads-pwdMaxIdle: 0
> > > ads-enabled: TRUE
> > >
> >
> >
> >
> > --
> > Kiran Ayyagari
> > http://keydap.com
> >
>



-- 
Kiran Ayyagari
http://keydap.com

Re: pwdHistory not validating properly (in custom server)

Posted by Patricio Demitrio <pd...@scoop-gmbh.de>.
Im pretty sure, yes.
When debugging, my interceptors listed are:
[org.apache.directory.server.core.normalization.NormalizationInterceptor@4f8771a
,
app.ldap.server.AuthenticationInterceptor2@54534e82,
org.apache.directory.server.core.referral.ReferralInterceptor@2947640e,
org.apache.directory.server.core.authz.AciAuthorizationInterceptor@df9e84e,
org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor@1202600d
,
org.apache.directory.server.core.admin.AdministrativePointInterceptor@59effeb7
,
org.apache.directory.server.core.exception.ExceptionInterceptor@1b3bce82,
org.apache.directory.server.core.schema.SchemaInterceptor@7372c6c5,
org.apache.directory.server.core.operational.OperationalAttributeInterceptor@7457eab9
,
org.apache.directory.server.core.collective.CollectiveAttributeInterceptor@37f3535b
,
org.apache.directory.server.core.subtree.SubentryInterceptor@47e5980f,
 org.apache.directory.server.core.event.EventInterceptor@326225a9,
org.apache.directory.server.core.trigger.TriggerInterceptor@49969416,
org.apache.directory.server.core.changelog.ChangeLogInterceptor@3cd45618,
org.apache.directory.server.core.journal.JournalInterceptor@186060db]


ABout the canges you mentioned, is there something newer than M11? Or
should I build something locally?

Thanks


On Fri, Apr 26, 2013 at 4:17 PM, Kiran Ayyagari <ka...@apache.org>wrote:

> did you disable the default AuthenticationInterceptor?
>
>
> On Fri, Apr 26, 2013 at 7:20 PM, Patricio Demitrio
> <pd...@scoop-gmbh.de>wrote:
>
> > Hi, I'm currently working with a custom M11 server, the only thing
> > different is a custom implementation of AuthenticatorInterceptor.
> >
> > When, from apacheDS, I try to change the user password, two different
> > things happen:
> > - If there is no pwdHistory present, the update works, and the pwdHistory
> > attribute is created.
> > - If pwdHistory exists, it throws me an error, even though the password
> is
> > completely different.
> >
> > The error is:
> >
> > 2013.04.24 14:23:56,445 DEBUG [pool-4-thread-2]
> > org.apache.directory.server.core.authn.AuthenticationInterceptor [] -
> > Operation Context: ModifyContext for Dn 'uid=00000005,dc=2013.04.24
> > 14:23:56,445
> > DEBUG [pool-4-thread-2]
> > org.apache.directory.server.core.authn.AuthenticationInterceptor [] -
> > Operation Context: ModifyContext for Dn
> 'uid=00000005,dc=company1,dc=com',
> > modifications :
> > Modification: replace
> > , attribute : userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66 0x74
> > 0x31 '
> >
> >
> > 2013.04.24 14:23:56,446 DEBUG [pool-4-thread-2]
> > org.apache.directory.server.ldap.handlers.LdapRequestHandler [] -
> > CONSTRAINT_VIOLATION: failed for MessageType : MODIFY_REQUEST
> > Message ID : 16
> >     Modify Request
> >         Object : 'uid=00000005,dc=company1,dc=com'
> >             Modification[0]
> >                 Operation :  replace
> >                 Modification
> > userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66 0x74 0x31 '
> > org.apache.directory.api.ldap.model.message.ModifyRequestImpl@fcebfd3b:
> > invalid reuse of password present in password history
> > org.apache.directory.api.ldap.model.exception.LdapOperationException:
> > invalid reuse of password present in password history
> > at
> >
> >
> org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:956)
> >  at
> >
> >
> app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
> > --->>>> extends from AuthenticationInterceptor. No added behaviour in
> this
> > example
> >  at
> >
> >
> org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
> > at
> >
> >
> org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:980)
> >  at
> >
> >
> app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
> > at
> >
> >
> org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
> >  at
> >
> >
> org.apache.directory.server.core.normalization.NormalizationInterceptor.modify(NormalizationInterceptor.java:223)
> > at
> >
> >
> org.apache.directory.server.core.DefaultOperationManager.modify(DefaultOperationManager.java:782)
> >  at
> >
> >
> org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:914)
> > at
> >
> >
> org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:897)
> >  at
> >
> >
> org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:56)
> > at
> >
> >
> org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:39)
> >  at
> >
> >
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:207)
> > at
> >
> >
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:56)
> >  at
> >
> >
> org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(DemuxingIoHandler.java:221)
> > at
> >
> >
> org.apache.directory.server.ldap.LdapProtocolHandler.messageReceived(LdapProtocolHandler.java:217)
> >  at
> >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690)
> > at
> >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
> >  at
> >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
> > at
> >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
> >  at
> >
> org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74)
> > at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
> >  at
> >
> >
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.runTask(UnorderedThreadPoolExecutor.java:474)
> > at
> >
> >
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.run(UnorderedThreadPoolExecutor.java:428)
> >  at java.lang.Thread.run(Thread.java:722)
> > 2013.04.24 14:23:56,449 DEBUG [pool-4-thread-2]
> > org.apache.mina.core.filterchain.IoFilterEvent [] - Event
> MESSAGE_RECEIVED
> > has been fired for session 1
> > 2013.04.24 14:23:56,449 DEBUG [NioProcessor-2]
> > org.apache.directory.server.ldap.handlers.LdapResponseHandler [] -
> Message
> > sent : MessageType : MODIFY_RESPONSE,dc=com', modifications :
> > Modification: replace
> > , attribute : userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66 0x74
> > 0x31 '
> >
> >
> > 2013.04.24 14:23:56,446 DEBUG [pool-4-thread-2]
> > org.apache.directory.server.ldap.handlers.LdapRequestHandler [] -
> > CONSTRAINT_VIOLATION: failed for MessageType : MODIFY_REQUEST
> > Message ID : 16
> >     Modify Request
> >         Object : 'uid=00000005,dc=company1,dc=com'
> >             Modification[0]
> >                 Operation :  replace
> >                 Modification
> > userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66 0x74 0x31 '
> > org.apache.directory.api.ldap.model.message.ModifyRequestImpl@fcebfd3b:
> > invalid reuse of password present in password history
> > org.apache.directory.api.ldap.model.exception.LdapOperationException:
> > invalid reuse of password present in password history
> > at
> >
> >
> org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:956)
> >  at
> >
> >
> app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
> > at
> >
> >
> org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
> >  at
> >
> >
> org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:980)
> > at
> >
> >
> app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
> >  at
> >
> >
> org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
> > at
> >
> >
> org.apache.directory.server.core.normalization.NormalizationInterceptor.modify(NormalizationInterceptor.java:223)
> >  at
> >
> >
> org.apache.directory.server.core.DefaultOperationManager.modify(DefaultOperationManager.java:782)
> > at
> >
> >
> org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:914)
> >  at
> >
> >
> org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:897)
> > at
> >
> >
> org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:56)
> >  at
> >
> >
> org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:39)
> > at
> >
> >
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:207)
> >  at
> >
> >
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:56)
> > at
> >
> >
> org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(DemuxingIoHandler.java:221)
> >  at
> >
> >
> org.apache.directory.server.ldap.LdapProtocolHandler.messageReceived(LdapProtocolHandler.java:217)
> > at
> >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690)
> >  at
> >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
> > at
> >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
> >  at
> >
> >
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
> > at
> >
> org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74)
> >  at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
> > at
> >
> >
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.runTask(UnorderedThreadPoolExecutor.java:474)
> >  at
> >
> >
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.run(UnorderedThreadPoolExecutor.java:428)
> > at java.lang.Thread.run(Thread.java:722)
> > 2013.04.24 14:23:56,449 DEBUG [pool-4-thread-2]
> > org.apache.mina.core.filterchain.IoFilterEvent [] - Event
> MESSAGE_RECEIVED
> > has been fired for session 1
> > 2013.04.24 14:23:56,449 DEBUG [NioProcessor-2]
> > org.apache.directory.server.ldap.handlers.LdapResponseHandler [] -
> Message
> > sent : MessageType : MODIFY_RESPONSE
> >
> >
> > I don't know if this helps, but here's some extra info:
> >
> > Entry
> >     dn[n]: uid=00000005,dc=company1,dc=com
> >     objectclass: top
> >     objectclass: extensibleObject
> >     objectclass: InetOrgPerson
> >     objectclass: organizationalPerson
> >     objectclass: person
> >     objectclass: pwdPolicy
> >     pwdHistory: '0x32 0x30 0x31 0x33 0x30 0x34 0x32 0x34 0x31 0x32 0x32
> > 0x33 0x32 0x39 0x2E 0x38 ...'
> >     pwdAllowUserChange: true
> >     uid: 00000005
> >     pwdPolicySubEntry:
> >
> >
> ads-pwdId=default,ou=passwordPolicies,ads-interceptorId=authenticationInterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config
> >     pwdReset: TRUE
> >     userPassword: '0x70 0x61 0x73 0x73 0x77 0x6F 0x72 0x64 0x31 '
> >     entryParentId: ccde56b4-aa2e-4738-af71-f15648d5e563
> >     distinguishedName: uid=00000005,dc=company1,dc=com
> >     pwdChangedTime: 20130410111201.584Z
> >     pwdAttribute: userPassword
> >     givenName: Michael
> >     c: DE
> >     cn: Michael Jackson
> >     sn: Jackson
> >     l: mjackson
> >     mail: mjackson@company1.de
> >     entryuuid: f679c2bb-e2f4-4987-8533-4d0b8407e876
> >     o: Test Company
> >     entryDN: uid=00000005,dc=company1,dc=com
> >     modifyTimestamp: 20130424122329.889Z
> >     entryCSN: 20130424122329.889000Z#000000#000#000000
> >     displayName: Michael Jackson
> >     modifiersName: 0.9.2342.19200300.100.1.1=admin,2.5.4.11=system
> >
> >
> > dn:
> >
> >
> ads-pwdId=default,ou=passwordPolicies,ads-interceptorId=authenticationInterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config
> > objectClass: top
> > objectClass: ads-base
> > objectClass: ads-passwordPolicy
> > ads-pwdId: default
> > ads-pwdSafeModify: FALSE
> > ads-pwdMaxAge: 0
> > ads-pwdFailureCountInterval: 30
> > ads-pwdAttribute: userPassword
> > ads-pwdMaxFailure: 5
> > ads-pwdLockout: TRUE
> > ads-pwdMustChange: FALSE
> > ads-pwdLockoutDuration: 0
> > ads-pwdMinLength: 5
> > ads-pwdInHistory: 5
> > ads-pwdExpireWarning: 0
> > ads-pwdMinAge: 0
> > ads-pwdAllowUserChange: TRUE
> > ads-pwdGraceAuthNLimit: 0
> > ads-pwdCheckQuality: 2
> > ads-pwdMaxLength: 0
> > ads-pwdGraceExpire: 0
> > ads-pwdMinDelay: 0
> > ads-pwdMaxDelay: 0
> > ads-pwdMaxIdle: 0
> > ads-enabled: TRUE
> >
>
>
>
> --
> Kiran Ayyagari
> http://keydap.com
>

Re: pwdHistory not validating properly (in custom server)

Posted by Kiran Ayyagari <ka...@apache.org>.
did you disable the default AuthenticationInterceptor?


On Fri, Apr 26, 2013 at 7:20 PM, Patricio Demitrio
<pd...@scoop-gmbh.de>wrote:

> Hi, I'm currently working with a custom M11 server, the only thing
> different is a custom implementation of AuthenticatorInterceptor.
>
> When, from apacheDS, I try to change the user password, two different
> things happen:
> - If there is no pwdHistory present, the update works, and the pwdHistory
> attribute is created.
> - If pwdHistory exists, it throws me an error, even though the password is
> completely different.
>
> The error is:
>
> 2013.04.24 14:23:56,445 DEBUG [pool-4-thread-2]
> org.apache.directory.server.core.authn.AuthenticationInterceptor [] -
> Operation Context: ModifyContext for Dn 'uid=00000005,dc=2013.04.24
> 14:23:56,445
> DEBUG [pool-4-thread-2]
> org.apache.directory.server.core.authn.AuthenticationInterceptor [] -
> Operation Context: ModifyContext for Dn 'uid=00000005,dc=company1,dc=com',
> modifications :
> Modification: replace
> , attribute : userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66 0x74
> 0x31 '
>
>
> 2013.04.24 14:23:56,446 DEBUG [pool-4-thread-2]
> org.apache.directory.server.ldap.handlers.LdapRequestHandler [] -
> CONSTRAINT_VIOLATION: failed for MessageType : MODIFY_REQUEST
> Message ID : 16
>     Modify Request
>         Object : 'uid=00000005,dc=company1,dc=com'
>             Modification[0]
>                 Operation :  replace
>                 Modification
> userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66 0x74 0x31 '
> org.apache.directory.api.ldap.model.message.ModifyRequestImpl@fcebfd3b:
> invalid reuse of password present in password history
> org.apache.directory.api.ldap.model.exception.LdapOperationException:
> invalid reuse of password present in password history
> at
>
> org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:956)
>  at
>
> app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
> --->>>> extends from AuthenticationInterceptor. No added behaviour in this
> example
>  at
>
> org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
> at
>
> org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:980)
>  at
>
> app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
> at
>
> org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
>  at
>
> org.apache.directory.server.core.normalization.NormalizationInterceptor.modify(NormalizationInterceptor.java:223)
> at
>
> org.apache.directory.server.core.DefaultOperationManager.modify(DefaultOperationManager.java:782)
>  at
>
> org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:914)
> at
>
> org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:897)
>  at
>
> org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:56)
> at
>
> org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:39)
>  at
>
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:207)
> at
>
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:56)
>  at
>
> org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(DemuxingIoHandler.java:221)
> at
>
> org.apache.directory.server.ldap.LdapProtocolHandler.messageReceived(LdapProtocolHandler.java:217)
>  at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690)
> at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
>  at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
> at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
>  at
> org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74)
> at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
>  at
>
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.runTask(UnorderedThreadPoolExecutor.java:474)
> at
>
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.run(UnorderedThreadPoolExecutor.java:428)
>  at java.lang.Thread.run(Thread.java:722)
> 2013.04.24 14:23:56,449 DEBUG [pool-4-thread-2]
> org.apache.mina.core.filterchain.IoFilterEvent [] - Event MESSAGE_RECEIVED
> has been fired for session 1
> 2013.04.24 14:23:56,449 DEBUG [NioProcessor-2]
> org.apache.directory.server.ldap.handlers.LdapResponseHandler [] - Message
> sent : MessageType : MODIFY_RESPONSE,dc=com', modifications :
> Modification: replace
> , attribute : userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66 0x74
> 0x31 '
>
>
> 2013.04.24 14:23:56,446 DEBUG [pool-4-thread-2]
> org.apache.directory.server.ldap.handlers.LdapRequestHandler [] -
> CONSTRAINT_VIOLATION: failed for MessageType : MODIFY_REQUEST
> Message ID : 16
>     Modify Request
>         Object : 'uid=00000005,dc=company1,dc=com'
>             Modification[0]
>                 Operation :  replace
>                 Modification
> userPassword: '0x73 0x63 0x6F 0x6F 0x70 0x73 0x6F 0x66 0x74 0x31 '
> org.apache.directory.api.ldap.model.message.ModifyRequestImpl@fcebfd3b:
> invalid reuse of password present in password history
> org.apache.directory.api.ldap.model.exception.LdapOperationException:
> invalid reuse of password present in password history
> at
>
> org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:956)
>  at
>
> app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
> at
>
> org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
>  at
>
> org.apache.directory.server.core.authn.AuthenticationInterceptor.modify(AuthenticationInterceptor.java:980)
> at
>
> app.ldap.server.AuthenticationInterceptor2.modify(AuthenticationInterceptor2.java:168)
>  at
>
> org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:577)
> at
>
> org.apache.directory.server.core.normalization.NormalizationInterceptor.modify(NormalizationInterceptor.java:223)
>  at
>
> org.apache.directory.server.core.DefaultOperationManager.modify(DefaultOperationManager.java:782)
> at
>
> org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:914)
>  at
>
> org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:897)
> at
>
> org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:56)
>  at
>
> org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:39)
> at
>
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:207)
>  at
>
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:56)
> at
>
> org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(DemuxingIoHandler.java:221)
>  at
>
> org.apache.directory.server.ldap.LdapProtocolHandler.messageReceived(LdapProtocolHandler.java:217)
> at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690)
>  at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
> at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
>  at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
> at
> org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74)
>  at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
> at
>
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.runTask(UnorderedThreadPoolExecutor.java:474)
>  at
>
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.run(UnorderedThreadPoolExecutor.java:428)
> at java.lang.Thread.run(Thread.java:722)
> 2013.04.24 14:23:56,449 DEBUG [pool-4-thread-2]
> org.apache.mina.core.filterchain.IoFilterEvent [] - Event MESSAGE_RECEIVED
> has been fired for session 1
> 2013.04.24 14:23:56,449 DEBUG [NioProcessor-2]
> org.apache.directory.server.ldap.handlers.LdapResponseHandler [] - Message
> sent : MessageType : MODIFY_RESPONSE
>
>
> I don't know if this helps, but here's some extra info:
>
> Entry
>     dn[n]: uid=00000005,dc=company1,dc=com
>     objectclass: top
>     objectclass: extensibleObject
>     objectclass: InetOrgPerson
>     objectclass: organizationalPerson
>     objectclass: person
>     objectclass: pwdPolicy
>     pwdHistory: '0x32 0x30 0x31 0x33 0x30 0x34 0x32 0x34 0x31 0x32 0x32
> 0x33 0x32 0x39 0x2E 0x38 ...'
>     pwdAllowUserChange: true
>     uid: 00000005
>     pwdPolicySubEntry:
>
> ads-pwdId=default,ou=passwordPolicies,ads-interceptorId=authenticationInterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config
>     pwdReset: TRUE
>     userPassword: '0x70 0x61 0x73 0x73 0x77 0x6F 0x72 0x64 0x31 '
>     entryParentId: ccde56b4-aa2e-4738-af71-f15648d5e563
>     distinguishedName: uid=00000005,dc=company1,dc=com
>     pwdChangedTime: 20130410111201.584Z
>     pwdAttribute: userPassword
>     givenName: Michael
>     c: DE
>     cn: Michael Jackson
>     sn: Jackson
>     l: mjackson
>     mail: mjackson@company1.de
>     entryuuid: f679c2bb-e2f4-4987-8533-4d0b8407e876
>     o: Test Company
>     entryDN: uid=00000005,dc=company1,dc=com
>     modifyTimestamp: 20130424122329.889Z
>     entryCSN: 20130424122329.889000Z#000000#000#000000
>     displayName: Michael Jackson
>     modifiersName: 0.9.2342.19200300.100.1.1=admin,2.5.4.11=system
>
>
> dn:
>
> ads-pwdId=default,ou=passwordPolicies,ads-interceptorId=authenticationInterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config
> objectClass: top
> objectClass: ads-base
> objectClass: ads-passwordPolicy
> ads-pwdId: default
> ads-pwdSafeModify: FALSE
> ads-pwdMaxAge: 0
> ads-pwdFailureCountInterval: 30
> ads-pwdAttribute: userPassword
> ads-pwdMaxFailure: 5
> ads-pwdLockout: TRUE
> ads-pwdMustChange: FALSE
> ads-pwdLockoutDuration: 0
> ads-pwdMinLength: 5
> ads-pwdInHistory: 5
> ads-pwdExpireWarning: 0
> ads-pwdMinAge: 0
> ads-pwdAllowUserChange: TRUE
> ads-pwdGraceAuthNLimit: 0
> ads-pwdCheckQuality: 2
> ads-pwdMaxLength: 0
> ads-pwdGraceExpire: 0
> ads-pwdMinDelay: 0
> ads-pwdMaxDelay: 0
> ads-pwdMaxIdle: 0
> ads-enabled: TRUE
>



-- 
Kiran Ayyagari
http://keydap.com

Re: pwdHistory not validating properly (in custom server)

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 4/26/13 3:50 PM, Patricio Demitrio a écrit :
> Hi, I'm currently working with a custom M11 server, the only thing
> different is a custom implementation of AuthenticatorInterceptor.
>
> When, from apacheDS, I try to change the user password, two different
> things happen:
> - If there is no pwdHistory present, the update works, and the pwdHistory
> attribute is created.
> - If pwdHistory exists, it throws me an error, even though the password is
> completely different.

Hi,

I have made many changes recently in this area. It would be interesting
to check your changes against trunk, to see if it works any better.


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com