AMUserPasswordValidationPlugin.java revision 8d2daf3b9ecfc9b9b306bab966eda82fe2201b19
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: AMUserPasswordValidationPlugin.java,v 1.4 2008/08/13 15:55:36 pawand Exp $
*
*/
/*
* Portions Copyrighted [2011] [ForgeRock AS]
*/
/**
* This class is an utility to detect the specified pattern in the given string
*
*/
public class AMUserPasswordValidationPlugin extends AMUserPasswordValidation
implements AMConstants {
public AMUserPasswordValidationPlugin() {
}
/**
* Checks for invalid characters in the source string
*
* @param userID
* source string which should be validated
* @param envParams
* parameters for which the userID validation is enforced.
* @throws throws
* AMException when it detects specified pattern within source
* string which need to be validated OR if source string is null
*/
{
+ "validateUserID() : Source string is null or empty"
+ userID);
}
+ "validateUserID() : List of invalid characters is null "
+ "or empty" + regEx);
}
while (st.hasMoreTokens()) {
+ "validateUserID() : Detected invalid chars ...");
+ "validateUserID() : User Name validation Failed:"
+ obj);
}
}
args);
}
}
try {
if (cachedValue != null) {
return cachedValue;
}
// Get the org config
return invalidChars;
} else {
return getGlobalUserInvalidChars(token);
}
return getGlobalUserInvalidChars(token);
}
}
// Org Config may not exist. Get default values
if (cachedValue != null) {
return cachedValue;
}
if (debug.messageEnabled()) {
+ "getGlobalUserInvalidChars(): Organization config for "
+ INVALID_USERID_CHARACTERS + ") not found. "
+ "Obtaining default service config values ..");
}
try {
if (defaultValues != null) {
return invalidChars;
}
} catch (Exception e) {
if (debug.warningEnabled()) {
+ "getGlobalUserInvalidChars(): Unable to get "
+ "UserID invalid characters", e);
}
}
return null;
}
}