I would implement it overriding the loginController
Spring bean. Make a copy of org.springframework.extensions.surf.mvc.LoginController.java
and add your your custom logic to handleRequestInternal
. request.getParameter("username")
and request.getHeader("Host")
should provide the values for the comparision.
One way to override the default implementation by placing the bean definition in a file alfresco/web-extension/custom-context.xml
in the classpath.
<bean id="loginController" class="CustomLoginController">
<property name="cacheSeconds" value="-1" />
<property name="useExpiresHeader"><value>true</value></property>
<property name="useCacheControlHeader"><value>true</value></property>
<property name="userFactory" ref="user.factory"></property>
<property name="connectorService" ref="connector.service" />
</bean>