2 Replies Latest reply: Nov 20, 2012 3:50 AM by Sudipto Desmukh RSS

    Programmatically locking user account in OID Jdev 11gR1

    Sudipto Desmukh
      Hi All ,
      Using Jdev 11.1.1.6

      Does anyone know an API using which we can lock a user's account in OID ?

      Though there is a way in which we can unlock the account programmatically -
          public void unlockAccount(User user) throws IMException {
              UserProfile usrprofile = user.getUserProfile();
               
              ModProperty mprop = new ModProperty("orclpwdaccountunlock",
                 "1",
                 ModProperty.ADD);
               
              usrprofile.setProperty(mprop);
          }
      But as rightly pointed out in the below thread , passing the property orclpwdaccountunlock as 0 (assuming it would have locked the account )is not allowed.
      https://forums.oracle.com/forums/thread.jspa?messageID=10698930

      Error -
      [LDAP: error code 53 - Account Policy Error :9051: GSL_ACCOUNTUNLOCK_EXCP :Invalid value specified for orclpwdaccountunlock attribute.
      The only allowed value is 1];