The Contacts Sample uses the Basic authentication mechanism to process credentials. That shows the correct filter ordering. You can optionally remove a whole lot of the other filters, like remember-me, anonymouse and authenticationProcessingFilter. In the end you'll need:
Code:
<bean id="filterChainProxy" class="net.sf.acegisecurity.util.FilterChainProxy">
<property name="filterInvocationDefinitionSource">
<value>
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/**=httpSessionContextIntegrationFilter,basicProcessingFilter,securityEnforcementFilter
</value>
</property>
</bean>