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


Java SecurityConfigurerAdapter類代碼示例

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


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

示例1: configure

import org.springframework.security.config.annotation.SecurityConfigurerAdapter; //導入依賴的package包/類
@Override
public void configure(HttpSecurity http) throws Exception {
    http.requestMatchers().anyRequest().and()
            .authorizeRequests().anyRequest()
            .authenticated().and().csrf()
            .csrfTokenRepository(csrfTokenRepository()).and()
            .addFilterAfter(csrfHeaderFilter(), CsrfFilter.class);

    OAuth2SsoProperties sso = this.beanFactory.getBean(OAuth2SsoProperties.class);
    // Delay the processing of the filter until we know the
    // SessionAuthenticationStrategy is available:
    http.apply(
            (SecurityConfigurerAdapter) new OAuth2ClientAuthenticationConfigurer(oauth2SsoFilter(sso))
    );
    addAuthenticationEntryPoint(http, sso);
}
 
開發者ID:dick-the-deployer,項目名稱:dick,代碼行數:17,代碼來源:SsoSecurityAutoConfiguration.java

示例2: getOrApply

import org.springframework.security.config.annotation.SecurityConfigurerAdapter; //導入依賴的package包/類
@SneakyThrows
private <C extends SecurityConfigurerAdapter<Void, ServiceProviderBuilder>> C getOrApply(
        C configurer) {
    C existingConfig = (C) getConfigurer(configurer.getClass());
    if (existingConfig != null) {
        return existingConfig;
    }
    return apply(configurer);
}
 
開發者ID:ulisesbocchio,項目名稱:spring-boot-security-saml,代碼行數:10,代碼來源:ServiceProviderBuilder.java

示例3: reApply

import org.springframework.security.config.annotation.SecurityConfigurerAdapter; //導入依賴的package包/類
@SneakyThrows
private <C extends SecurityConfigurerAdapter<Void, ServiceProviderBuilder>> void reApply(C configurer) {
    C existing = (C) removeConfigurer(configurer.getClass());
    apply(existing);
}
 
開發者ID:ulisesbocchio,項目名稱:spring-boot-security-saml,代碼行數:6,代碼來源:ServiceProviderBuilder.java


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