Java Code Examples for org.wso2.carbon.identity.application.common.util.IdentityApplicationManagementUtil#getPropertyValue()

The following examples show how to use org.wso2.carbon.identity.application.common.util.IdentityApplicationManagementUtil#getPropertyValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RandomPasswordProcessor.java    From carbon-identity-framework with Apache License 2.0 6 votes vote down vote up
/**
 * Remove original passwords with random passwords when sending password properties to UI front-end
 *
 * @param properties
 */
public Property[] removeOriginalPasswords(Property[] properties) {

    if (ArrayUtils.isEmpty(properties)) {
        return new Property[0];
    }

    properties = addUniqueIdProperty(properties);
    String uuid = IdentityApplicationManagementUtil
            .getPropertyValue(properties, IdentityApplicationConstants.UNIQUE_ID_CONSTANT);
    String randomPhrase = IdentityApplicationConstants.RANDOM_PHRASE_PREFIX + uuid;
    RandomPassword[] randomPasswords = replaceOriginalPasswordsWithRandomPasswords(
            randomPhrase, properties);
    if (!ArrayUtils.isEmpty(randomPasswords)) {
        addPasswordContainerToCache(randomPasswords, uuid);
    }

    return properties;
}
 
Example 2
Source File: RandomPasswordProcessor.java    From carbon-identity-framework with Apache License 2.0 6 votes vote down vote up
/**
 * Remove random passwords with original passwords when sending password properties to Service Back-end
 *
 * @param properties
 */
public Property[] removeRandomPasswords(Property[] properties, boolean withCacheClear) {

    if (ArrayUtils.isEmpty(properties)) {
        return new Property[0];
    }

    String uuid = IdentityApplicationManagementUtil.getPropertyValue(properties,
            IdentityApplicationConstants.UNIQUE_ID_CONSTANT);
    if (StringUtils.isBlank(uuid)) {
        if (log.isDebugEnabled()) {
            log.debug("Cache Key not found for Random Password Container");
        }
    } else {
        properties = removeUniqueIdProperty(properties);
        RandomPassword[] randomPasswords = getRandomPasswordContainerFromCache(uuid, withCacheClear);
        if (!ArrayUtils.isEmpty(randomPasswords)) {
            replaceRandomPasswordsWithOriginalPasswords(properties,
                    randomPasswords);
        }
    }
    return properties;
}
 
Example 3
Source File: RandomPasswordProcessor.java    From carbon-identity with Apache License 2.0 6 votes vote down vote up
/**
 * Remove original passwords with random passwords when sending password properties to UI front-end
 * @param properties
 */
public Property[] removeOriginalPasswords(Property[] properties){

    if (ArrayUtils.isEmpty(properties)){
        return new Property[0];
    }

    properties = addUniqueIdProperty(properties);
    String uuid = IdentityApplicationManagementUtil
            .getPropertyValue(properties, IdentityApplicationConstants.UNIQUE_ID_CONSTANT);
    String randomPhrase = IdentityApplicationConstants.RANDOM_PHRASE_PREFIX + uuid;
    RandomPassword[] randomPasswords = replaceOriginalPasswordsWithRandomPasswords(
            randomPhrase, properties);
    if (!ArrayUtils.isEmpty(randomPasswords)) {
        addPasswordContainerToCache(randomPasswords, uuid);
    }

    return properties;
}
 
Example 4
Source File: RandomPasswordProcessor.java    From carbon-identity with Apache License 2.0 6 votes vote down vote up
/**
 * Remove random passwords with original passwords when sending password properties to Service Back-end
 * @param properties
 */
public Property[] removeRandomPasswords(Property[] properties, boolean withCacheClear) {

    if (ArrayUtils.isEmpty(properties)) {
        return new Property[0];
    }

    String uuid = IdentityApplicationManagementUtil.getPropertyValue(properties,
                                                                     IdentityApplicationConstants.UNIQUE_ID_CONSTANT);
    if (StringUtils.isBlank(uuid)) {
        if (log.isDebugEnabled()) {
            log.debug("Cache Key not found for Random Password Container");
        }
    } else {
        properties = removeUniqueIdProperty(properties);
        RandomPassword[] randomPasswords = getRandomPasswordContainerFromCache(uuid, withCacheClear);
        if (!ArrayUtils.isEmpty(randomPasswords)) {
            replaceRandomPasswordsWithOriginalPasswords(properties,
                                                        randomPasswords);
        }
    }
    return properties;
}