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


Java AbstractAuthenticationProcessingFilter類代碼示例

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


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

示例1: init

import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; //導入依賴的package包/類
@Override
public void init(HttpSecurity http) throws Exception {
    autowireThis(http);

    http.logout().addLogoutHandler(logoutHandler);
    fieldMutator.update(
        http.formLogin(),
        "authFilter",
        AbstractAuthenticationProcessingFilter.class,
        new UsernamePasswordAuthenticationFilterWrapper()
    );
    http.addFilterBefore(authenticationFilter, UsernamePasswordAuthenticationFilter.class);
}
 
開發者ID:shiver-me-timbers,項目名稱:smt-spring-security-parent,代碼行數:14,代碼來源:JwtSpringSecurityAdaptor.java

示例2: createCustomFilter

import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; //導入依賴的package包/類
protected AbstractAuthenticationProcessingFilter createCustomFilter() throws Exception {
	//here we define the interfaces which don't need any authorisation
	AuthFilter filter = new AuthFilter(new NegatedRequestMatcher(
	  new AndRequestMatcher(
		 new AntPathRequestMatcher("/login"),
		 new AntPathRequestMatcher("/health")
	  )
	));
	filter.setAuthenticationManager(authenticationManagerBean());
	return filter;
}
 
開發者ID:rainu,項目名稱:spring-custom-token-auth,代碼行數:12,代碼來源:WebSecurityConfig.java

示例3: addRecaptchaSupport

import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; //導入依賴的package包/類
public FormLoginConfigurer<HttpSecurity> addRecaptchaSupport(FormLoginConfigurer<HttpSecurity> loginConfigurer) {
    Field authFilterField = findField(loginConfigurer.getClass(), AUTHENTICATION_PROCESSING_FILTER_FIELD, AbstractAuthenticationProcessingFilter.class);
    makeAccessible(authFilterField);
    setField(authFilterField, loginConfigurer, authenticationFilter);
    return loginConfigurer.usernameParameter(DEFAULT_USERNAME_PARAMETER)
            .successHandler(successHandler)
            .failureHandler(failureHandler);
}
 
開發者ID:mkopylec,項目名稱:recaptcha-spring-boot-starter,代碼行數:9,代碼來源:FormLoginConfigurerEnhancer.java

示例4: onActivate

import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; //導入依賴的package包/類
@Log
void onActivate(String loginError) {
    if ("error".equals(loginError)) {
        this.errorMessage = ((Exception) request
                .getSession(true)
                .getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY))
                .getMessage();
        logger.error(String.format("Error while attempting to login: %s",
                errorMessage));
    }

}
 
開發者ID:dlwhitehurst,項目名稱:musicrecital,代碼行數:13,代碼來源:Login.java

示例5: filterUsesConfiguredFailureHandler

import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; //導入依賴的package包/類
@Test
public void filterUsesConfiguredFailureHandler() throws Exception {
  final Field failureHandlerField = AbstractAuthenticationProcessingFilter.class.getDeclaredField("failureHandler");
  ReflectionUtils.makeAccessible(failureHandlerField);
  AuthenticationFailureHandler failureHandler = (AuthenticationFailureHandler) ReflectionUtils.getField(failureHandlerField, filter);
  assertTrue("failure handler should be a simpleUrlFailureHandler", failureHandler instanceof SimpleUrlAuthenticationFailureHandler);

  final Field failureUrlField = SimpleUrlAuthenticationFailureHandler.class.getDeclaredField("defaultFailureUrl");
  ReflectionUtils.makeAccessible(failureUrlField);
  String failureUrl = (String) ReflectionUtils.getField(failureUrlField, failureHandler);
  assertEquals("failure URL should be the configured url", "/oauth/confirm_access", failureUrl);
}
 
開發者ID:jungyang,項目名稱:oauth-client-master,代碼行數:13,代碼來源:AuthorizationServerBeanDefinitionParserTests.java

示例6: authenticationFilter

import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; //導入依賴的package包/類
protected Filter authenticationFilter() {

            AbstractAuthenticationProcessingFilter filter =
                    new SecurityContextAuthenticationFilter(SIGNIN_SUCCESS_PATH);
            SavedRequestAwareAuthenticationSuccessHandler successHandler =
                    new SavedRequestAwareAuthenticationSuccessHandler();
            successHandler.setDefaultTargetUrl("/admin");
            filter.setAuthenticationSuccessHandler(successHandler);
            return filter;
        }
 
開發者ID:spring-io,項目名稱:sagan,代碼行數:11,代碼來源:SecurityConfig.java

示例7: update

import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; //導入依賴的package包/類
@Override
public AbstractAuthenticationProcessingFilter update(AbstractAuthenticationProcessingFilter filter) {
    return new WrappedUsernamePasswordAuthenticationFilter(
        fieldMutator, (UsernamePasswordAuthenticationFilter) filter, authenticationSuccessHandler
    );
}
 
開發者ID:shiver-me-timbers,項目名稱:smt-spring-security-parent,代碼行數:7,代碼來源:JwtSpringSecurityAdaptor.java

示例8: hackFormLoginAuthFilter

import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; //導入依賴的package包/類
public static FormLoginConfigurer<HttpSecurity> hackFormLoginAuthFilter(FormLoginConfigurer<HttpSecurity> formLoginConfig, AbstractAuthenticationProcessingFilter filter){
	ReflectUtils.getIntro(FormLoginConfigurer.class).setFieldValue(formLoginConfig, "authFilter", filter);
	return formLoginConfig;
}
 
開發者ID:wayshall,項目名稱:onetwo,代碼行數:5,代碼來源:SecurityUtils.java

示例9: createOAuth2Filter

import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; //導入依賴的package包/類
private AbstractAuthenticationProcessingFilter createOAuth2Filter(ClientResourceDetails clientDetails, AuthenticationSuccessHandler successHandler, String path) {
    CustomOAuthAuthenticationProcessingFilter oauthFilter = new CustomOAuthAuthenticationProcessingFilter(path, clientDetails, jsonMessageConverter);
    oauthFilter.setAuthenticationSuccessHandler(successHandler);
    return oauthFilter;
}
 
開發者ID:HelfenKannJeder,項目名稱:come2help,代碼行數:6,代碼來源:OAuth2ClientConfigurer.java


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