mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged 5.1-MC1 (5.1.0) to HEAD (5.1)
119055 adavis: Merged 5.1.N (5.1.1) to 5.1-MC1 (5.1.0) 117337 adavis: Merged 5.0.2-CLOUD42 (Cloud ) to 5.1.N (5.1.1) 117245 adavis: Merged 5.0.2-CLOUD (Cloud ) to 5.0.2-CLOUD42 (Cloud ) 114514 adavis: Merged BCRYPT to 5.0.2-CLOUD 113819 gcornwell: MNT-14892: Final test fix git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@119893 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -46,6 +46,7 @@ import org.alfresco.repo.policy.BehaviourFilter;
|
|||||||
import org.alfresco.repo.security.authentication.AuthenticationContext;
|
import org.alfresco.repo.security.authentication.AuthenticationContext;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationException;
|
import org.alfresco.repo.security.authentication.AuthenticationException;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
|
import org.alfresco.repo.security.authentication.ShaPasswordEncoderImpl;
|
||||||
import org.alfresco.repo.tenant.TenantUtil.TenantRunAsWork;
|
import org.alfresco.repo.tenant.TenantUtil.TenantRunAsWork;
|
||||||
import org.alfresco.repo.thumbnail.ThumbnailRegistry;
|
import org.alfresco.repo.thumbnail.ThumbnailRegistry;
|
||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||||
@@ -59,6 +60,7 @@ import org.alfresco.service.cmr.view.RepositoryExporterService;
|
|||||||
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
|
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
|
||||||
import org.alfresco.service.cmr.workflow.WorkflowService;
|
import org.alfresco.service.cmr.workflow.WorkflowService;
|
||||||
import org.alfresco.service.transaction.TransactionService;
|
import org.alfresco.service.transaction.TransactionService;
|
||||||
|
import org.alfresco.util.GUID;
|
||||||
import org.alfresco.util.PropertyCheck;
|
import org.alfresco.util.PropertyCheck;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
@@ -944,8 +946,20 @@ public class MultiTAdminServiceImpl implements TenantAdminService, ApplicationCo
|
|||||||
|
|
||||||
if (tenantAdminRawPassword != null)
|
if (tenantAdminRawPassword != null)
|
||||||
{
|
{
|
||||||
String salt = null; // GUID.generate();
|
// TODO: This needs to be replaced with the composite password encoder
|
||||||
props.put("alfresco_user_store.adminpassword", passwordEncoder.encodePassword(new String(tenantAdminRawPassword), salt));
|
// and use the new passwordHash property but some further thought
|
||||||
|
// is required how to handle the case where no passsword is provided
|
||||||
|
// as we can no longer presume what hash encoding is being used.
|
||||||
|
// Or maybe this is fine as the background job will upgrade the user object?
|
||||||
|
|
||||||
|
// generate the new MD4 password hash
|
||||||
|
props.put("alfresco_user_store.adminpassword", passwordEncoder.encodePassword(new String(tenantAdminRawPassword), null));
|
||||||
|
|
||||||
|
// generate the new SHA256 password hash
|
||||||
|
String salt = props.getProperty("alfresco_user_store.adminsalt");
|
||||||
|
ShaPasswordEncoderImpl sha256PasswordEncoder = new ShaPasswordEncoderImpl(256);
|
||||||
|
String sha256Password = sha256PasswordEncoder.encodePassword(new String(tenantAdminRawPassword), salt);
|
||||||
|
props.put("alfresco_user_store.adminpassword2", sha256Password);
|
||||||
}
|
}
|
||||||
|
|
||||||
userImporterBootstrap.bootstrap();
|
userImporterBootstrap.bootstrap();
|
||||||
|
Reference in New Issue
Block a user