当前位置: 首页>>代码示例>>Java>>正文


Java PathMatchingFilterChainResolver.setFilterChainManager方法代码示例

本文整理汇总了Java中org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver.setFilterChainManager方法的典型用法代码示例。如果您正苦于以下问题:Java PathMatchingFilterChainResolver.setFilterChainManager方法的具体用法?Java PathMatchingFilterChainResolver.setFilterChainManager怎么用?Java PathMatchingFilterChainResolver.setFilterChainManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver的用法示例。


在下文中一共展示了PathMatchingFilterChainResolver.setFilterChainManager方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createInstance

import org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver; //导入方法依赖的package包/类
@Override
protected AbstractShiroFilter createInstance() throws Exception {
	SecurityManager securityManager = getSecurityManager();
	if (securityManager == null){
		throw new BeanInitializationException("SecurityManager property must be set.");
	}

	if (!(securityManager instanceof WebSecurityManager)){
		throw new BeanInitializationException("The security manager does not implement the WebSecurityManager interface.");
	}

	PathMatchingFilterChainResolver chainResolver = new PathMatchingFilterChainResolver();
	FilterChainManager chainManager = createFilterChainManager();
	chainResolver.setFilterChainManager(chainManager);
	return new MySpringShiroFilter((WebSecurityManager)securityManager, chainResolver);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:17,代码来源:MyShiroFilterFactoryBean.java

示例2: createChainResolver

import org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver; //导入方法依赖的package包/类
protected FilterChainResolver createChainResolver(Map<String, Filter> chainFilters) {
    DefaultFilterChainManager chainManager = new DefaultFilterChainManager();

    // load filters
    chainFilters.forEach((name, filter) -> chainManager.addFilter(name, filter));

    if (urls != null) {
        urls.forEach((url, value) -> {
            LOGGER.info("Loading url chain {} -> {}", url, value);
            chainManager.createChain(url, value);
        });
    }

    PathMatchingFilterChainResolver resolver = new PathMatchingFilterChainResolver();
    resolver.setFilterChainManager(chainManager);
    return resolver;
}
 
开发者ID:bootique,项目名称:bootique-shiro,代码行数:18,代码来源:MappedShiroFilterFactory.java

示例3: getFilterChainResolver

import org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver; //导入方法依赖的package包/类
/**
 * @return the default filter chain resolver for this application
 */
@Produces
public FilterChainResolver getFilterChainResolver() {

    if (this.filterChainResolver == null) {

        final FilterChainManager chainManager = new DefaultFilterChainManager();

        chainManager.addFilter("anon", new AnonymousFilter());
        chainManager.addFilter("authc", this.configureFormAuthentication());
        chainManager.addFilter("perms", new PermissionsAuthorizationFilter());

        final PathMatchingFilterChainResolver resolver
                = new PathMatchingFilterChainResolver();

        chainManager.createChain("/secured/**", "authc");
        chainManager.createChain("/index.xhtml", "anon");
        
        resolver.setFilterChainManager(chainManager);
        
        this.filterChainResolver = resolver;
    }
    return this.filterChainResolver;
}
 
开发者ID:arthurgregorio,项目名称:exemplos,代码行数:27,代码来源:ShiroConfiguration.java

示例4: init

import org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver; //导入方法依赖的package包/类
@Override
public void init() throws Exception {
    super.init();


    String shiroConfigFile = GojaConfig.getAppSecurityConfig();
    final File configFolderFile = GojaConfig.getConfigFolderFile();
    shiroConfig = configFolderFile == null ? PropKit.use(shiroConfigFile).getProperties()
            : PropKit.use(FileUtils.getFile(configFolderFile, shiroConfigFile)).getProperties();

    WebSecurityManager webSecurityManager = initSecurityManager();
    FilterChainManager manager = createFilterChainManager();

    //Expose the constructed FilterChainManager by first wrapping it in a
    // FilterChainResolver implementation. The AbstractShiroFilter implementations
    // do not know about FilterChainManagers - only resolvers:
    PathMatchingFilterChainResolver chainResolver = new PathMatchingFilterChainResolver();
    chainResolver.setFilterChainManager(manager);

    setSecurityManager(webSecurityManager);
    setFilterChainResolver(chainResolver);
}
 
开发者ID:GojaFramework,项目名称:goja,代码行数:23,代码来源:GojaShiroFilter.java

示例5: FDWebEnvironment

import org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver; //导入方法依赖的package包/类
public FDWebEnvironment() {
    BasicHttpAuthenticationFilter authc = new CorsBasicHttpAuthenticationFilter();
    LogoutFilter logout = new LogoutFilter();
    logout.setRedirectUrl("http://www.freedomotic.com/");
    
    FilterChainManager fcMan = new DefaultFilterChainManager();
    fcMan.addFilter("authc", authc);
    fcMan.addFilter("logout", logout);
    fcMan.createChain("/auth/logout", "logout");
    fcMan.createChain("/v3/**", "authc");

    PathMatchingFilterChainResolver resolver = new PathMatchingFilterChainResolver();
    resolver.setFilterChainManager(fcMan);

    setFilterChainResolver(resolver);
    setWebSecurityManager(RestAPIv3.defaultWebSecurityManager);
}
 
开发者ID:freedomotic,项目名称:freedomotic,代码行数:18,代码来源:FDWebEnvironment.java

示例6: getFilterChainResolver

import org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver; //导入方法依赖的package包/类
@Produces
public FilterChainResolver getFilterChainResolver() {
    FilterChainResolver filterChainResolver = null;
    if (filterChainResolver == null) {
        FormAuthenticationFilter authc = new FormAuthenticationFilter();
        AnonymousFilter anon = new AnonymousFilter();
        UserFilter user = new UserFilter();

        authc.setLoginUrl(WebPages.LOGIN_URL);
        user.setLoginUrl(WebPages.LOGIN_URL);

        FilterChainManager fcMan = new DefaultFilterChainManager();
        fcMan.addFilter("authc", authc);
        fcMan.addFilter("anon", anon);
        fcMan.addFilter("user", user);

        fcMan.createChain("/index.html", "anon");
        fcMan.createChain("/css/**", "anon");
        fcMan.createChain("/api/**", "anon");
        fcMan.createChain(WebPages.LOGIN_URL, "authc");
        fcMan.createChain("/**", "user");

        PathMatchingFilterChainResolver resolver = new PathMatchingFilterChainResolver();
        resolver.setFilterChainManager(fcMan);
        filterChainResolver = resolver;
    }
    return filterChainResolver;
}
 
开发者ID:nebrass,项目名称:pairing-shiro-javaee7,代码行数:29,代码来源:ShiroConfiguration.java

示例7: getFilterChainResolver

import org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver; //导入方法依赖的package包/类
/**
 * @return the default filter chain resolver for this application
 */
@Produces
public FilterChainResolver getFilterChainResolver() {

    if (this.filterChainResolver == null) {

        final FilterChainManager chainManager = new DefaultFilterChainManager();

        chainManager.addFilter("anon", new AnonymousFilter());
        chainManager.addFilter("authc", this.configureFormAuthentication());
        chainManager.addFilter("perms", new PermissionsAuthorizationFilter());

        final PathMatchingFilterChainResolver resolver
                = new PathMatchingFilterChainResolver();

        chainManager.createChain("/index.xhtml", "anon");
        
        chainManager.createChain("/secured/car/**", "perms[car:access]");
        chainManager.createChain("/secured/owner/**", "perms[owner:access]");
        
        chainManager.createChain("/secured/**", "authc");
        chainManager.createChain("/api/**", "authcBasic");
        
        resolver.setFilterChainManager(chainManager);
        
        this.filterChainResolver = resolver;
    }
    return this.filterChainResolver;
}
 
开发者ID:arthurgregorio,项目名称:exemplos,代码行数:32,代码来源:ShiroConfiguration.java


注:本文中的org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver.setFilterChainManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。