1 Reply Latest reply: Apr 21, 2013 8:47 AM by MFadel RSS

    Save modified password.

    MFadel
      Hello,

      I'm using JDeveloper 11.1.1.3. I'm trying change the password of a user. I found this code for changing the password and it worked:
                    String encryptedOldPassword = this.MD5(this.getOldpassword()).toUpperCase(); 
                    JpsContextFactory jps = JpsContextFactory.getContextFactory();
                    JpsContext jpsContext=jps.getContext();
                    IdentityStoreService storeService = jpsContext.getServiceInstance(IdentityStoreService.class);
                    IdentityStore is = storeService.getIdmStore();
                    UserManager mn = is.getUserManager();
                    boolean flag=mn.isModifyUserSupported();
                    User user = (User)is.searchUser(ADFContext.getCurrent().getSecurityContext().getUserName());
                    UserProfile userprofile =user.getUserProfile();
                    char[] oldp=this.getOldpassword().toString().toCharArray();
                    char[] newp=this.getNewpassword().toString().toCharArray();
                    userprofile.setPassword(oldp,newp);
      But my question is how do i save the new password? When i rerun the application, the password is set back to what was originally set.


      Thanks,

      Mohamed.