當前位置: 首頁>>代碼示例>>Java>>正文


Java DefaultSecurityFilterChain類代碼示例

本文整理匯總了Java中org.springframework.security.web.DefaultSecurityFilterChain的典型用法代碼示例。如果您正苦於以下問題:Java DefaultSecurityFilterChain類的具體用法?Java DefaultSecurityFilterChain怎麽用?Java DefaultSecurityFilterChain使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DefaultSecurityFilterChain類屬於org.springframework.security.web包,在下文中一共展示了DefaultSecurityFilterChain類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: samlFilter

import org.springframework.security.web.DefaultSecurityFilterChain; //導入依賴的package包/類
@Bean
public FilterChainProxy samlFilter() throws Exception {
    List<SecurityFilterChain> chains = new ArrayList<SecurityFilterChain>();
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/login/**"),
            samlEntryPoint()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/logout/**"),
            samlLogoutFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/metadata/**"),
            metadataDisplayFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSO/**"),
            samlWebSSOProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSOHoK/**"),
            samlWebSSOHoKProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SingleLogout/**"),
            samlLogoutProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/discovery/**"),
            samlIDPDiscovery()));
    return new FilterChainProxy(chains);
}
 
開發者ID:lhartikk,項目名稱:spring-tsers-auth,代碼行數:20,代碼來源:WebSecurityConfig.java

示例2: springSecurityFilterChain

import org.springframework.security.web.DefaultSecurityFilterChain; //導入依賴的package包/類
@Bean(name = "springSecurityFilterChain")
public FilterChainProxy springSecurityFilterChain() throws ServletException, Exception {

    final List<SecurityFilterChain> listOfFilterChains = new ArrayList<SecurityFilterChain>();

    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/cors")));
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/dump")));
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/validatorUrl")));
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/swagger-resources")));
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/configuration/ui")));
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/configuration/security")));
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/v2/api-docs")));
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/swagger-ui.html")));
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/webjars/**")));
    // no filters
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/webjars/**")));// no filters
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/*"), securityContextPersistenceFilterWithASCFalse(),
            usernamePasswordAuthenticationFilter(), sessionManagementFilter(), exceptionTranslationFilter(), filterSecurityInterceptor()));

    final FilterChainProxy filterChainProxy = new FilterChainProxy(listOfFilterChains);

    return filterChainProxy;
}
 
開發者ID:tvajjala,項目名稱:interview-preparation,代碼行數:24,代碼來源:WebSecurityConfig.java

示例3: springSecurityFilterChain

import org.springframework.security.web.DefaultSecurityFilterChain; //導入依賴的package包/類
@Bean(name = "springSecurityFilterChain")
public FilterChainProxy springSecurityFilterChain() throws ServletException, Exception {

    final List<SecurityFilterChain> listOfFilterChains = new ArrayList<SecurityFilterChain>();
    // listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/login"), new NoSecurityFilter()));

    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/validatorUrl")));
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/swagger-resources")));
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/configuration/ui")));
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/configuration/security")));
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/v2/api-docs")));
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/swagger-ui.html")));
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/webjars/**")));
    // no filters
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/webjars/**")));// no filters
    listOfFilterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/api/**"), securityContextPersistenceFilterWithASCFalse(),
            exceptionTranslationFilter(), filterSecurityInterceptor()));

    final FilterChainProxy filterChainProxy = new FilterChainProxy(listOfFilterChains);

    return filterChainProxy;
}
 
開發者ID:tvajjala,項目名稱:interview-preparation,代碼行數:23,代碼來源:WebSecurityConfig.java

示例4: samlFilter

import org.springframework.security.web.DefaultSecurityFilterChain; //導入依賴的package包/類
/**
 * SAML Filter.
 * @return SAMLFilter
 * @throws Exception Exception
 */
@Bean
public FilterChainProxy samlFilter() throws Exception {
    List<SecurityFilterChain> chains = new ArrayList<>();
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/login/**"),
        samlEntryPoint()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/logout/**"),
        samlLogoutFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSO/**"),
        samlWebSSOProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSOHoK/**"),
        samlWebSSOHoKProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SingleLogout/**"),
        samlLogoutProcessingFilter()));
     return new FilterChainProxy(chains);
}
 
開發者ID:takesection,項目名稱:spring-boot-saml2,代碼行數:21,代碼來源:WebSecurityConfig.java

示例5: samlFilter

import org.springframework.security.web.DefaultSecurityFilterChain; //導入依賴的package包/類
private FilterChainProxy samlFilter(SAMLEntryPoint samlEntryPoint, SAMLContextProvider contextProvider) {
	List<SecurityFilterChain> chains = new ArrayList<>();
	chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/login/**"),
		samlEntryPoint));
	chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/metadata/**"),
		new MetadataDisplayFilter()));
	try {
		chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSO/**"),
			samlWebSSOProcessingFilter(samlAuthenticationProvider, contextProvider, samlProcessor)));
	} catch (Exception e) {
		e.printStackTrace();
	}
	SAMLDiscovery samlDiscovery = new SAMLDiscovery();
	samlDiscovery.setMetadata(cachingMetadataManager);
	samlDiscovery.setContextProvider(contextProvider);
	chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/discovery/**"),
		samlDiscovery));
	return new FilterChainProxy(chains);
}
 
開發者ID:spring-projects,項目名稱:spring-security-saml-dsl,代碼行數:20,代碼來源:SAMLConfigurer.java

示例6: samlFilter

import org.springframework.security.web.DefaultSecurityFilterChain; //導入依賴的package包/類
/**
 * Define the security filter chain in order to support SSO Auth by using SAML 2.0
 *
 * @return Filter chain proxy
 * @throws Exception
 */
@Bean
public FilterChainProxy samlFilter() throws Exception {
    List<SecurityFilterChain> chains = new ArrayList<SecurityFilterChain>();
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/login/**"), samlEntryPoint()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/logout/**"), samlLogoutFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/metadata/**"),
                                              metadataDisplayFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSO/**"),
                                              samlWebSSOProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSOHoK/**"),
                                              samlWebSSOHoKProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SingleLogout/**"),
                                              samlLogoutProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/discovery/**"), samlIDPDiscovery()));
    return new FilterChainProxy(chains);
}
 
開發者ID:chrludwig,項目名稱:websec-saml2sp,代碼行數:23,代碼來源:SamlSpringSecurityConfig.java

示例7: samlFilter

import org.springframework.security.web.DefaultSecurityFilterChain; //導入依賴的package包/類
/**
 * Define the security filter chain in order to support SSO Auth by using SAML 2.0
 *
 * @return Filter chain proxy
 * @throws Exception
 */
@Bean
public FilterChainProxy samlFilter() throws Exception {
    List<SecurityFilterChain> chains = new ArrayList<SecurityFilterChain>();
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/login/**"),
            new TargetStoringFilter(),
            samlEntryPoint()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/logout/**"),
            new TargetStoringFilter(),
            samlLogoutFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/metadata/**"),
            metadataDisplayFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSO/**"),
            samlWebSSOProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SingleLogout/**"),
            samlLogoutProcessingFilter()));
    return new FilterChainProxy(chains);
}
 
開發者ID:solita,項目名稱:kansalaisaloite,代碼行數:24,代碼來源:WebSecurityConfig.java

示例8: samlFilter

import org.springframework.security.web.DefaultSecurityFilterChain; //導入依賴的package包/類
/**
* Define the security filter chain in order to support SSO Auth by using SAML 2.0
* 
* @return Filter chain proxy
* @throws Exception
*/
  @Bean
  public FilterChainProxy samlFilter() throws Exception {
      List<SecurityFilterChain> chains = new ArrayList<SecurityFilterChain>();
      chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/login/**"),
              samlEntryPoint()));
      chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/logout/**"),
              samlLogoutFilter()));
      chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/metadata/**"),
              metadataDisplayFilter()));
      chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSO/**"),
              samlWebSSOProcessingFilter()));
      chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSOHoK/**"),
              samlWebSSOHoKProcessingFilter()));
      chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SingleLogout/**"),
              samlLogoutProcessingFilter()));
      chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/discovery/**"),
              samlIDPDiscovery()));
      return new FilterChainProxy(chains);
  }
 
開發者ID:vdenotaris,項目名稱:spring-boot-security-saml-sample,代碼行數:26,代碼來源:WebSecurityConfig.java

示例9: samlFilter

import org.springframework.security.web.DefaultSecurityFilterChain; //導入依賴的package包/類
@Bean
public FilterChainProxy samlFilter() throws Exception {
    List<SecurityFilterChain> chains = new ArrayList<>();
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/login/**"),
        samlEntryPoint()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/metadata/**"),
        metadataDisplayFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSO/**"),
        samlWebSSOProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/discovery/**"),
        samlIDPDiscovery()));
    return new FilterChainProxy(chains);
}
 
開發者ID:jadekler,項目名稱:git-java-okta-saml-example,代碼行數:14,代碼來源:SAMLConfiguration.java

示例10: filterChainProxy

import org.springframework.security.web.DefaultSecurityFilterChain; //導入依賴的package包/類
@Bean
public FilterChainProxy filterChainProxy() throws Exception {
    //@formatter:off
    return new FilterChainProxy(ImmutableList.<SecurityFilterChain>of(
            new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/login/**"), samlEntryPoint()),
            new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/logout/**"), samlLogoutFilter()),
            new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/metadata/**"), metadataDisplayFilter()),
            new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSO/**"), samlProcessingFilter()),
            new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSOHoK/**"), samlWebSSOHoKProcessingFilter()),
            new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SingleLogout/**"), samlLogoutProcessingFilter()),
            new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/discovery/**"), samlIDPDiscovery())
    ));
    //@formatter:on
}
 
開發者ID:choonchernlim,項目名稱:spring-security-adfs-saml2,代碼行數:15,代碼來源:SAMLWebSecurityConfigurerAdapter.java

示例11: filterChain

import org.springframework.security.web.DefaultSecurityFilterChain; //導入依賴的package包/類
private List<SecurityFilterChain> filterChain() {
List<SecurityFilterChain> filters = new ArrayList<SecurityFilterChain>(12);
       RequestMatcher req = new AntPathRequestMatcher("/**");
       
       filters.add(new DefaultSecurityFilterChain(req, new SecurityContextPersistenceFilter(), 
               logoutFilter(),cojAuthenticationProcessingFilter(),new SecurityContextHolderAwareRequestFilter(),
               rememberMeAuthenticationFilter(),anonymousAuthenticationFilter(),exceptionTranslationFilter(),filterInvocationInterceptor()
               ));
return filters;
   }
 
開發者ID:dovier,項目名稱:coj-web,代碼行數:11,代碼來源:SecurityConfiguration.java

示例12: getFilterChainProxy

import org.springframework.security.web.DefaultSecurityFilterChain; //導入依賴的package包/類
/**
 * Gets the filter chain proxy.
 *
 * @return the filter chain proxy
 */
@Bean(name = "filterChainProxy")
public FilterChainProxy getFilterChainProxy() {
  SecurityFilterChain chain = new DefaultSecurityFilterChain(new AntPathRequestMatcher("/**"),
      getSecurityContextPersistenceFilter(), getJ2eePreAuthenticatedProcessingFilter(),
      getLogoutFilter(), getExceptionTranslationFilter(), getFilterSecurityInterceptor());
  return new FilterChainProxy(chain);
}
 
開發者ID:psi-probe,項目名稱:psi-probe,代碼行數:13,代碼來源:ProbeSecurityConfig.java

示例13: configure

import org.springframework.security.web.DefaultSecurityFilterChain; //導入依賴的package包/類
@Override
protected void configure(HttpSecurity http) throws Exception {

  http.csrf().disable();
  http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);

  String[] restEndpointsToSecure = { "api/admin"};
  for (String endpoint : restEndpointsToSecure) {
    http.authorizeRequests().antMatchers("/" + endpoint + "/**").hasRole(CustomUserDetailsService.ROLE_USER);
  }

  SecurityConfigurer<DefaultSecurityFilterChain, HttpSecurity> securityConfigurerAdapter = new XAuthTokenConfigurer(userDetailsServiceBean());
  http.apply(securityConfigurerAdapter);
}
 
開發者ID:IBM-Cloud,項目名稱:session-questions,代碼行數:15,代碼來源:Config.java

示例14: configure

import org.springframework.security.web.DefaultSecurityFilterChain; //導入依賴的package包/類
@Override
protected void configure(HttpSecurity http) throws Exception {

    http.csrf().disable();
    http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);

    String[] restEndpointsToSecure = { "news"};
    for (String endpoint : restEndpointsToSecure) {
        http.authorizeRequests().antMatchers("/" + endpoint + "/**").hasRole(CustomUserDetailsService.ROLE_USER);
    }

    SecurityConfigurer<DefaultSecurityFilterChain, HttpSecurity> securityConfigurerAdapter = new XAuthTokenConfigurer(userDetailsServiceBean());
    http.apply(securityConfigurerAdapter);
}
 
開發者ID:joshlong,項目名稱:boot-examples,代碼行數:15,代碼來源:Application.java


注:本文中的org.springframework.security.web.DefaultSecurityFilterChain類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。