private static boolean checkUserPassword ( String userSecurityName , String password , UserRegistry registry , String realmName , Hashtable < String , Object > addedCred , Invocation isCCInvoked ) { // 675924 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "checkUserPassword user: " + userSecurityName + ", realm: " + realmName ) ; } if ( userSecurityName == null || password == null ) { Tr . error ( tc , "INVALID_USERNAME_PASSWORD_INBOUND_J2CA0674" , userSecurityName ) ; // 673415 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , new Object [ ] { userSecurityName , password } ) ; } return false ; // 675924 } boolean match = validateCallbackInformation ( addedCred , userSecurityName , isCCInvoked ) ; // 675924 if ( ! match ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , " - invalid username and password." ) ; } return false ; // 675924 } try { registry . checkPassword ( userSecurityName , password ) ; String uniqueId = registry . getUniqueUserId ( userSecurityName ) ; uniqueId = stripRealm ( uniqueId , realmName ) ; // 669627 List < String > uniqueGroups = new ArrayList < String > ( ) ; List < ? > groupNames = registry . getGroupsForUser ( userSecurityName ) ; if ( groupNames != null ) for ( Object group : groupNames ) { uniqueGroups . add ( registry . getUniqueGroupId ( ( String ) group ) ) ; } updateCustomHashtable ( addedCred , realmName , uniqueId , userSecurityName , uniqueGroups ) ; } catch ( PasswordCheckFailedException e ) { // This error is thrown when there is no entry corresponding to the username and password // in the registry. Tr . error ( tc , "INVALID_USERNAME_PASSWORD_INBOUND_J2CA0674" , userSecurityName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , " - invalid username and password" ) ; // 675924 } return false ; // 675924 } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ejs.j2c.work.security.J2CSecurityHelper.checkUserPassword" , "%C" ) ; Tr . error ( tc , "VALIDATION_FAILED_INBOUND_J2CA0684" , userSecurityName ) ; // 675924 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , " - unable to validate password." ) ; } return false ; // 675924 } // End 673415 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , " - password is valid." ) ; } return true ; }
Checks the user name and password against the user registry provided . If the user name and password are valid it returns true .