02-11-2011 08:46 AM
02-11-2011 11:43 AM
03-01-2011 05:26 AM
03-22-2011 08:32 AM
public class MyUserAuthenticationImpl extends AbstractAuthenticationComponent {
(…)
@Override
protected void authenticateImpl(String userName, char[] password) {
if (!checkUserAndPasswordOnDatabase(userName, password))
throw new AuthenticationException("Invalid credentials.");
// Successfully authenticated…
clearCurrentSecurityContext();
setCurrentUser(userName);
}
private boolean checkUserAndPasswordOnDatabase(String username, char[] password) {
// TODO: Implement your SQL query here…
}
}
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="authenticationComponent" class="MyUserAuthenticationImpl"
parent="authenticationComponentBase">
<property name="nodeService">
<ref bean="nodeService" />
</property>
<property name="personService">
<ref bean="personService" />
</property>
<property name="transactionService">
<ref bean="transactionService" />
</property>
</bean>
<bean id="localAuthenticationService"
class="org.alfresco.repo.security.authentication.AuthenticationServiceImpl">
<property name="ticketComponent">
<ref bean="ticketComponent" />
</property>
<property name="authenticationComponent">
<ref bean="authenticationComponent" />
</property>
<property name="sysAdminParams">
<ref bean="sysAdminParams" />
</property>
</bean>
</beans>
authentication.chain=myUserAuthentication1:myUserAuthentication
07-28-2011 05:14 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.