Monday, April 4, 2016

Custom EBS password complexity

When I tried to create a new user in a non-prod R12.1 instance, I got below error:

Unable to load java class oracle.apps.custom.security.XXXXXPasswordValidation specified profile option SIGNON_PASSWORD_CUSTOM. Please verify that the class exists and that it implements the java interface oracle.apps.custom.security.XXXXXPasswordValidation

I checked profile option Signon Password Custom which had "oracle.apps.custom.security.XXXXXPasswordValidation" on site level. I ran below query and did not see the custom Java class in the database. So that error makes sense because it was not uploaded to the database.

SQL> SELECT dbms_java.longname(object_name), status
 FROM user_objects
 WHERE object_type = 'JAVA CLASS'
 AND dbms_java.longname(object_name) like '%PasswordValidation';

 DBMS_JAVA.LONGNAME(OBJECT_NAME)        STATUS
 oracle/apps/fnd/security/PasswordValidation           VALID
 oracle/apps/fnd/security/AppsPasswordValidation   VALID 


Fortunately I found the Java files are still saved in the file system. So I uploaded it to the database:

$ cd $JAVA_TOP/oracle/apps/custom/security
$ ls -al
-rwxrwxrwx 1 trainer users 1927 Nov  8  2013 XXXXXPasswordValidation.class
-rwxrwxrwx 1 trainer users 2629 Feb  6  2012 XXXXXPasswordValidation.java

$ loadjava -user apps/appsPWD -verbose -resolve -force XXXXXPasswordValidation.class
arguments: '-user' 'apps/appsPWD' '-verbose' '-resolve' '-force' 'XXXXXPasswordValidation.class'
creating : class oracle/apps/custom/security/XXXXXPasswordValidation
loading  : class oracle/apps/custom/security/XXXXXPasswordValidation
resolving: class oracle/apps/custom/security/XXXXXPasswordValidation


SQL> SELECT dbms_java.longname(object_name), status
 FROM user_objects
 WHERE object_type = 'JAVA CLASS'
 AND dbms_java.longname(object_name) like '%PasswordValidation';

DBMS_JAVA.LONGNAME(OBJECT_NAME)                STATUS
oracle/apps/custom/security/XXXXXPasswordValidation  VALID
oracle/apps/fnd/security/PasswordValidation                    VALID
oracle/apps/fnd/security/AppsPasswordValidation            VALID


After those steps, I was able to create EBS user if the password meets the complexity defined in the custom Java file.

Since oracle/apps/fnd/security/PasswordValidation exists in the database, I assumed it is an Oracle standard class and so I changed profile option Signon Password Custom from  "oracle.apps.custom.security.XXXXXPasswordValidation" to "oracle.apps.fnd.security.PasswordValidation".  But when I tried to create a user now , I got error:

Unable to load Java class oracle.apps.fnd.security.PasswordValidation specified in profile option SIGNON_PASSWORD_CUSTOM. Please verify that the class exists and that it implements the Java interface oracle.apps.fnd.security.PasswordValidation.

As an exercise, I re-uploaded the Java class to the database:

$ cd $JAVA_TOP/oracle/apps/fnd/security
$ ls -al PasswordValidation.class
-rwxrwxrwx 1 trainer users 673 Jan  3  2007 PasswordValidation.class

$ loadjava -user apps/appsPWD -verbose -resolve -force PasswordValidation.class
arguments: '-user' 'apps/appsPWD' '-verbose' '-resolve' '-force' 'PasswordValidation.class'
creating : class oracle/apps/fnd/security/PasswordValidation
loading  : class oracle/apps/fnd/security/PasswordValidation
resolving: class oracle/apps/fnd/security/PasswordValidation

Interestingly, that made it and other Java classes INVALID in the database.I had to run adadmin to compile APPS schema to make them VALID again. Seems that oracle.apps.fnd.security.PasswordValidation can not be used or it is a wrong value to put in profile option Signon Password Custom.

The custom Java code looks like: 
$ view XXXXXPasswordValidation.java

package oracle.apps.custom.security;

import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.security.*;
import java.*;

// Referenced classes of package oracle.apps.fnd.security:
// PasswordValidation

public class XXXXXPasswordValidation implements PasswordValidation
{

due to copy right, no detail here...

}

Updates:
Profile option "Signon Password Failure Limit" defines maximum number of tries allowed before user account becomes locked.
Profile option "Signon Password No Reuse" defines minimum number of days that a user must wait before being allowed to reuse a password.

4 comments:

Unknown said...

Hi,

Can you pls. help to share the code for the custom password validation. I am getting error while trying to build the policy that includes the special character and capital letter. Your kind help on this will be highly appreciated.

bash-3.00$ loadjava -user apps/apps -verbose -resolve -force AppsPasswordValidationCUS.java
initialization complete
loading : oracle/apps/fnd/security/AppsPasswordValidationCUS
creating : oracle/apps/fnd/security/AppsPasswordValidationCUS
resolver :
resolving: oracle/apps/fnd/security/AppsPasswordValidationCUS
errors : oracle/apps/fnd/security/AppsPasswordValidationCUS
ORA-29535: source requires recompilation
oracle/apps/fnd/security/AppsPasswordValidationCUS:11: Class java.util.regex.Matcher not found in import.
oracle/apps/fnd/security/AppsPasswordValidationCUS:12: Class java.util.regex.Pattern not found in import.
Info: 2 errors
loadjava: 4 errors

Thanks & Regards,
Ahmad

J Y said...

Should you upload *.class file, instead?

chandan said...

Hi

I have go through the your post for Gather Schema Stats for weekly.Could you please share the all screen shot.scree shot is here but overlapped.

Sanjay said...

What is AppsPasswordValidationCUS is invalid, what action do we need to take,

SQL> SELECT dbms_java.longname(object_name), status
FROM user_objects
WHERE object_type = 'JAVA CLASS'
AND dbms_java.longname(object_name) like '%PasswordValidation%'; 2 3 4

DBMS_JAVA.LONGNAME(OBJECT_NAME)
--------------------------------------------------------------------------------
STATUS
-------
oracle/apps/fnd/security/AppsPasswordValidation
VALID

oracle/apps/fnd/security/AppsPasswordValidationCUS
INVALID

oracle/apps/fnd/security/PasswordValidation
VALID