directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Carlo.Acco...@ibs-ag.com>
Subject Trying to use PwdModifyRequest
Date Mon, 09 Dec 2013 18:19:35 GMT
Hi, we would like to port some of our password functionality over to a PwdModifyRequest . I'm
trying the code below but keep getting cast exception..  Any hints about what I'm doing wrong?
Thanks!

Also, should the connection used for the extended request always be an administrative bind?
 I think yes.


                     PwdModifyRequestImpl pwReq = new PwdModifyRequestImpl();
                     pwReq.setUserIdentity(Strings.getBytesUtf8(strDn));
                     pwReq.setOldPassword(Strings.getBytesUtf8(strCurrentPassword));
                     pwReq.setNewPassword(Strings.getBytesUtf8(strNewPassword));


                     PwdModifyResponse modResponse;
                     try
                     {
                           ExtendedResponse exRes = connection.extended(pwReq);
                           modResponse = ((PasswordModifyResponseDecorator)exRes).getDecorated();
                           System.out.println(modResponse);
                     }
                     catch(Exception e)
                     {
                           e.printStackTrace();
                     }


java.lang.ClassCastException: org.apache.directory.api.ldap.codec.api.ExtendedResponseDecorator
cannot be cast to org.apache.directory.api.ldap.extras.extended.ads_impl.pwdModify.PasswordModifyResponseDecorator



Carlo Accorsi

IBS America
A Siemens Business

24 Hartwell Ave | Lexington | Massachusetts | 02421
+1-781-862-9002 x129 (Office) | +1-781-676-8129 (Direct) | +1-781-862-9003 (Fax)
www.ibs-us.com<http://www.ibs-us.com/> | carlo.accorsi@ibs-ag.com<mailto:carlo.accorsi@ibs-ag.com>

Connect With Us:
Twitter<https://twitter.com/IBSAmerica> | Facebook<https://www.facebook.com/pages/IBS-America-Inc/126278080785762>
| LinkedIn<http://www.linkedin.com/company/2118605?trk=tyah> | Blog<http://info.ibs-us.com/>
| Our Events<http://www.ibs-us.com/de/company/events/index.html>

The Quality Management System of: IBS America, Inc.
has been assessed and approved by National Quality Assurance, U.S.A.,
against the provisions of:
ISO 9001: 2008


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message