本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}