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


Java FilterChainManager.createChain方法代码示例

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


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

示例1: DefaultFilterChainResolver

import org.apache.shiro.web.filter.mgt.FilterChainManager; //导入方法依赖的package包/类
@Inject
public DefaultFilterChainResolver(
		Set<FilterChainConfigurator> filterChainConfigurators, 
		BasicAuthenticationFilter basicAuthenticationFilter) {
	
	super();
	
	FilterChainManager filterChainManager = getFilterChainManager();
	
	filterChainManager.addFilter("authcBasic", basicAuthenticationFilter);
	
	for (FilterChainConfigurator configurator: filterChainConfigurators) {
		configurator.configure(filterChainManager);
	}
	
	filterChainManager.createChain("/**", "authcBasic");
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:18,代码来源:DefaultFilterChainResolver.java

示例2: createChains

import org.apache.shiro.web.filter.mgt.FilterChainManager; //导入方法依赖的package包/类
protected void createChains(Map<String, String> urls, FilterChainManager manager) {
    if (CollectionUtils.isEmpty(urls)) {
        if (log.isDebugEnabled()) {
            log.debug("No urls to process.");
        }
        return;
    }

    if (log.isTraceEnabled()) {
        log.trace("Before url processing.");
    }

    for (Map.Entry<String, String> entry : urls.entrySet()) {
        String path = entry.getKey();
        String value = entry.getValue();
        manager.createChain(path, value);
    }
}
 
开发者ID:xuegongzi,项目名称:rabbitframework,代码行数:19,代码来源:IniFilterChainResolverFactory.java

示例3: getFilterChainResolver

import org.apache.shiro.web.filter.mgt.FilterChainManager; //导入方法依赖的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: FDWebEnvironment

import org.apache.shiro.web.filter.mgt.FilterChainManager; //导入方法依赖的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

示例5: getFilterChainResolver

import org.apache.shiro.web.filter.mgt.FilterChainManager; //导入方法依赖的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

示例6: getFilterChainResolver

import org.apache.shiro.web.filter.mgt.FilterChainManager; //导入方法依赖的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.FilterChainManager.createChain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。