zoukankan      html  css  js  c++  java
  • shiro中多用户的登陆页面(multiple login pages)配置

    shiro中多用户的登陆页面(multiple login pages)配置

             <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>

    由此可以很轻松的配置多个工程路口,比如有状态和无状态时,拥有不同的登录接口,但是希望能够共用原先的处理逻辑,此时只需要配置多个不同类型的登录页面即可。
    ————————————————
    版权声明:本文为CSDN博主「南宫酥卿」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/win7system/article/details/50827250

    shiro中多用户的登陆页面(multiple login pages)配置
    [Shiro zhōng duō yònghù de dēnglù yèmiàn (multiple login pages) pèizhì]
    shiro in multi-user login page (multiple login pages) Configuration
  • 相关阅读:
    Spring Security教程(一):初识Spring Security
    权限管理系统(二):权限管理系统介绍
    OAuth 2.0介绍
    Java的spi介绍和简单应用
    Spring Boot 2.0官方文档之 Actuator(转)
    Nginx(三):日志文件管理
    Mybatis(五):Mybatis的三种使用方式
    Mybatis里Mapper映射sql文件里insert的主键返回selectKey使用
    Mybatis(四):MyBatis核心组件介绍原理解析和源码解读
    flask-限流器
  • 原文地址:https://www.cnblogs.com/hfultrastrong/p/12553682.html
Copyright © 2011-2022 走看看