directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: 2 issues with Password policy response warnings / types
Date Fri, 22 Jun 2012 21:14:58 GMT
Le 6/22/12 10:54 PM, Carlo.Accorsi@ibs-ag.com a écrit :
> Thanks that's great!	
There is also a class that handle all the decoding and creates a plain 
Java object with all the expected data :

         DefaultLdapCodecService codec = new DefaultLdapCodecService();

         PasswordPolicyDecorator control = new PasswordPolicyDecorator( 
codec, true );

         // bb contains the received bytes :
         ByteBuffer bb = ByteBuffer.allocate( 0xA );

         bb.put( new byte[]
             {
                 0x30, 0x08,
                   ( byte ) 0xA0, 0x03, // timeBeforeExpiration
                     ( byte ) 0x80, 0x01, 0x01,
                   ( byte ) 0x81, 0x01, 0x01 // ppolicyError
         } );

         bb.flip();

         PasswordPolicy passwordPolicy = ( PasswordPolicy ) 
control.decode( bb.array() );


Here, you can no do :

         if ( passwordPolicy.hasResponse() )
         {
             int expiration = 
passwordPolicy.getResponse().getTimeBeforeExpiration();
             int error = 
passwordPolicy.getResponse().getPasswordPolicyError().getValue();
         }


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


Mime
View raw message