<bean id="authenticator
class="org.apache.shiro.authc.pam.ModularRealmAuthenticator">
<property name="realms">
<list>
<ref bean="jdbcRealm" />
<ref bean="secondShiroRealm" />
</list>
</property>
</bean>
<!--
3 配置Realm
3.1 直接配置实现了org.apache.shiro.realm.Realm的bean
-->
<bean id="jdbcRealm" class="org.lfz.shiro.realms.ShiroRealm">
<!-- 使用MD5加密 -->
<property name="credentialsMatcher">
<bean class="org.apache.shiro.authc.credential.HashedCredentialsMatcher">
<property name="hashAlgorithmName" value="MD5"></property>
<property name="hashIterations" value="1024"></property>
</bean>
</property>
</bean>
<!-- SecondShiroRealm -->
<bean id="secondShiroRealm" class="org.lfz.shiro.realms.SecondShiroRealm">
<!-- 使用SHA1加密 -->
<property name="credentialsMatcher">
<bean class="org.apache.shiro.authc.credential.HashedCredentialsMatcher">
<property name="hashAlgorithmName" value="SHA1"></property>
<property name="hashIterations" value="1024"></property>
</bean>
</property>
</bean>