mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged 5.0.2-CLOUD42 (Cloud ) to 5.1.N (5.1.1)
117244 adavis: Merged 5.0.2-CLOUD (Cloud ) to 5.0.2-CLOUD42 (Cloud ) 114513 adavis: Merged BCRYPT to 5.0.2-CLOUD 113804 gcornwell: MNT-14892: More test fixes git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@117336 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -103,12 +103,13 @@ public class AuthenticationComponentImpl extends AbstractAuthenticationComponent
|
|||||||
public String doWork() throws Exception
|
public String doWork() throws Exception
|
||||||
{
|
{
|
||||||
String normalized = getPersonService().getUserIdentifier(userName);
|
String normalized = getPersonService().getUserIdentifier(userName);
|
||||||
|
String finalUserName = normalized == null ? userName : normalized;
|
||||||
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
|
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
|
||||||
normalized == null ? userName : normalized, new String(password));
|
finalUserName, new String(password));
|
||||||
authenticationManager.authenticate(authentication);
|
authenticationManager.authenticate(authentication);
|
||||||
|
|
||||||
// check whether the user's password requires re-hashing
|
// check whether the user's password requires re-hashing
|
||||||
UserDetails userDetails = authenticationDao.loadUserByUsername(userName);
|
UserDetails userDetails = authenticationDao.loadUserByUsername(finalUserName);
|
||||||
if (userDetails instanceof RepositoryAuthenticatedUser)
|
if (userDetails instanceof RepositoryAuthenticatedUser)
|
||||||
{
|
{
|
||||||
List<String> hashIndicator = ((RepositoryAuthenticatedUser)userDetails).getHashIndicator();
|
List<String> hashIndicator = ((RepositoryAuthenticatedUser)userDetails).getHashIndicator();
|
||||||
|
@@ -1,3 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2005-2015 Alfresco Software Limited.
|
||||||
|
*
|
||||||
|
* This file is part of Alfresco
|
||||||
|
*
|
||||||
|
* Alfresco is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Alfresco is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
package org.alfresco.repo.security.authentication;
|
package org.alfresco.repo.security.authentication;
|
||||||
|
|
||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||||
@@ -7,6 +25,12 @@ import org.alfresco.service.transaction.TransactionService;
|
|||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transaction listener that re-generates the hash of a users password in
|
||||||
|
* the afterCommit callback.
|
||||||
|
*
|
||||||
|
* @author Gavin Cornwell
|
||||||
|
*/
|
||||||
public class HashPasswordTransactionListener implements TransactionListener
|
public class HashPasswordTransactionListener implements TransactionListener
|
||||||
{
|
{
|
||||||
private static Log logger = LogFactory.getLog(HashPasswordTransactionListener.class);
|
private static Log logger = LogFactory.getLog(HashPasswordTransactionListener.class);
|
||||||
|
Reference in New Issue
Block a user