【问题标题】:apache shiro url matching with apache tapestryapache shiro url 与 apache 挂毯匹配
【发布时间】:2018-11-25 00:29:18
【问题描述】:

这是我的配置

configuration.add(factory.createChain("/abc/*")
            .add(factory.anon()).build());
    configuration.add(factory.createChain("/pdf/pdfReport/*")
            .add(factory.authc()).build());
    configuration.add(factory.createChain("/*").add(factory.authc())
            .build());

我面临的问题是 /abc 在根路径中,如果我将其设为匿名,那么 shiro 仍会将其重定向到登录页面。

我猜 /* 正在覆盖 /abc 请求并发送每个根请求以进行身份​​验证,因为如果我评论此代码

configuration.add(factory.createChain("/*").add(factory.authc())
            .build());

然后我可以匿名访问 /abc。任何人都可以指导我如何保留两者并仍然实现 mu 功能

【问题讨论】:

    标签: shiro tapestry


    【解决方案1】:

    我想通了。我只需要给

    configuration.add(factory.createChain("/abc")
            .add(factory.anon()).build());
    

    而不是 /* 因为 /* 已经为链中 / 之后的每个 url 进行了身份验证

    【讨论】:

      猜你喜欢
      • 2012-01-29
      • 2012-09-02
      • 2016-12-17
      • 2023-01-03
      • 2020-05-30
      • 2019-06-29
      • 2016-09-28
      • 2013-09-03
      • 2018-09-03
      相关资源
      最近更新 更多