directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Carlo.Acco...@ibs-ag.com>
Subject RE: Trying to use PwdModifyRequest
Date Mon, 09 Dec 2013 21:27:21 GMT
Ok will try that! Thanks

-----Original Message-----
From: ayyagarikiran@gmail.com [mailto:ayyagarikiran@gmail.com] On Behalf Of Kiran Ayyagari
Sent: Monday, December 09, 2013 2:26 PM
To: users@directory.apache.org
Subject: Re: Trying to use PwdModifyRequest

run after setting
System.setProperty( StandaloneLdapApiService.EXTENDED_OPERATIONS_LIST,
"org.apache.directory.api.ldap.extras.extended.ads_impl.pwdModify.PasswordModifyFactory"
);


On Mon, Dec 9, 2013 at 11:49 PM, <Carlo.Accorsi@ibs-ag.com> wrote:

> 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.Passw
> ordModifyResponseDecorator
>
>
>
> 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
>
>


--
Kiran Ayyagari
http://keydap.com

Mime
View raw message