Example usage for org.apache.shiro.spring.web ShiroFilterFactoryBean getFilterChainDefinitionMap

List of usage examples for org.apache.shiro.spring.web ShiroFilterFactoryBean getFilterChainDefinitionMap

Introduction

In this page you can find the example usage for org.apache.shiro.spring.web ShiroFilterFactoryBean getFilterChainDefinitionMap.

Prototype

public Map<String, String> getFilterChainDefinitionMap() 

Source Link

Document

Returns the chainName-to-chainDefinition map of chain definitions to use for creating filter chains intercepted by the Shiro Filter.

Usage

From source file:stroom.security.spring.SecurityConfiguration.java

License:Apache License

@Bean(name = "shiroFilter")
public AbstractShiroFilter shiroFilter() throws Exception {
    final ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean();
    shiroFilter.setSecurityManager(securityManager());
    shiroFilter.setLoginUrl("/login.html");
    shiroFilter.setSuccessUrl("/stroom.jsp");
    shiroFilter.getFilters().put("jwtFilter", new JWTAuthenticationFilter());
    //        shiroFilter.getFilterChainDefinitionMap().put("/**/secure/*", "authc, roles[USER]");
    shiroFilter.getFilterChainDefinitionMap().put("/rest/*", "jwtFilter");
    shiroFilter.getFilterChainDefinitionMap().put("/rest/**/*", "jwtFilter");
    shiroFilter.getFilterChainDefinitionMap().put("/index", "jwtFilter");
    shiroFilter.getFilterChainDefinitionMap().put("/index/*", "jwtFilter");
    shiroFilter.getFilterChainDefinitionMap().put("/**/rest/*", "jwtFilter");
    return (AbstractShiroFilter) shiroFilter.getObject();
}