shiro in multi-user login page (multiple login pages) Configuration

shiro in multi-user login page (multiple login pages) Configuration

 

         <bean id="membersAuthc"
            class="org.apache.shiro.web.filter.authc.FormAuthenticationFilter">
            <property name="loginUrl" value="${frontPath}/loginl" />
            <property name="successUrl" value="${frontPath}" />
        </bean>
        <bean id="adminAuthc"
            class="org.apache.shiro.web.filter.authc.FormAuthenticationFilter">
            <property name="loginUrl" value="${adminPath}/login" />
            <property name="successUrl" value="${adminPath}" />
        </bean>
        <bean id="adminUser" class="org.apache.shiro.web.filter.authc.UserFilter">
            <property name="loginUrl" value="${adminPath}/login" />
        </bean>
        <bean id="frontUser" class="org.apache.shiro.web.filter.authc.UserFilter">
            <property name="loginUrl" value="${frontPath}/login" />
        </bean>
        <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
            <property name="securityManager" ref="securityManager" />
            <property name="loginUrl" value="${adminPath}/login" />
            <property name="successUrl" value="${adminPath}" />
            <property name="filters">
                <map>
                    <entry key="authc" value-ref="formAuthenticationFilter" />
                    <entry key="membersAuthc" value-ref="membersAuthc" />
                    <entry key="adminAuthc" value-ref="adminAuthc" />
                    <entry key="adminUser" value-ref="adminUser" />
                </map>
            </property>
            <property name="filterChainDefinitions">
                <value>
                    /static/** = anon
                    /userfiles/** = anon
                    ${adminPath}/login = authc
                    ${adminPath}/logout = logout
                    ${adminPath}/** = adminUser
                    ${frontPath}/show* = frontUser
                </value>
            </property>
        </bean>

It can easily configure multiple projects intersection, such as when there are state and non-state, have different login interfaces, but want to share the original processing logic, this time only need to configure a number of different types of login page.
----------------
Disclaimer: This article is CSDN blogger original article "Qing Palace crisp", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source and link this statement.
Original link: https: //blog.csdn.net/win7system/article/details/50827250

shiro in multi-user login page (multiple login pages) Configuration
[Shiro Call Zhong Yonghe de dēnglù food (multiple login pages) pèizhì]
shiro in multi-user login page (multiple login pages) Configuration

Guess you like

Origin www.cnblogs.com/hfultrastrong/p/12553682.html