diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/handler/provisioning/impl/DefaultProvisioningHandler.java b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/handler/provisioning/impl/DefaultProvisioningHandler.java index ca93cc69e2df..e7f9db680e5e 100644 --- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/handler/provisioning/impl/DefaultProvisioningHandler.java +++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/handler/provisioning/impl/DefaultProvisioningHandler.java @@ -359,10 +359,14 @@ tobeDeleted claims (claims came from federated idp as null). If there is a match protected char[] resolvePassword(Map userClaims) { - char[] passwordFromUser = (userClaims.get(FrameworkConstants.PASSWORD) != null) - ? userClaims.get(FrameworkConstants.PASSWORD).toCharArray() : null; - return (passwordFromUser != null && passwordFromUser.length > 0) ? - passwordFromUser : generatePassword(); + char[] passwordFromUser = null; + if (userClaims.get(FrameworkConstants.PASSWORD) != null) { + passwordFromUser = userClaims.get(FrameworkConstants.PASSWORD).toCharArray(); + } + if (passwordFromUser == null || passwordFromUser.length == 0) { + return generatePassword(); + } + return passwordFromUser; } private void handleV1Roles(String username, UserStoreManager userStoreManager, UserRealm realm,