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


Java AuthenticationFailureHandler类代码示例

本文整理汇总了Java中org.springframework.security.web.authentication.AuthenticationFailureHandler的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationFailureHandler类的具体用法?Java AuthenticationFailureHandler怎么用?Java AuthenticationFailureHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AuthenticationFailureHandler类属于org.springframework.security.web.authentication包,在下文中一共展示了AuthenticationFailureHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: failureLogin

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
public AuthenticationFailureHandler failureLogin(){
	AuthenticationFailureHandler handler = new AuthenticationFailureHandler() {
		
		@Override
		public void onAuthenticationFailure(HttpServletRequest arg0,
				HttpServletResponse arg1, AuthenticationException arg2)
				throws IOException, ServletException {
			
			System.out.println("SecurityConfig.failureLogin()#httpservletrequest\n"
					+ ReflectionToStringBuilder.toString(arg0, ToStringStyle.SIMPLE_STYLE)
					+ "\n----------------"
					+ "\ngetQueryString: " + arg0.getQueryString()
					+ "\ngetRequestURI: " + arg0.getRequestURI()
					+ "\ngetServletPath: " + arg0.getServletPath()
					+ "\ngetRequestURL: " + arg0.getRequestURL()
					+ "\n\n"
			);
			
			 arg1.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
	         arg1.sendRedirect("login");  
			
		}
	}; 
	
	return handler;
}
 
开发者ID:gleb619,项目名称:hotel_shop,代码行数:27,代码来源:SecurityConfig.java

示例2: authenticationFailureHandler

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
@Bean
public AuthenticationFailureHandler authenticationFailureHandler() {
    ExceptionMappingAuthenticationFailureHandler failureHandler = new ExceptionMappingAuthenticationFailureHandler();
    Map<String, String> failureUrlMap = new HashMap<>();
    failureUrlMap.put(BadCredentialsException.class.getName(), LoginAuthenticationFailureHandler.PASS_ERROR_URL);
    failureUrlMap.put(CaptchaException.class.getName(), LoginAuthenticationFailureHandler.CODE_ERROR_URL);
    failureUrlMap.put(AccountExpiredException.class.getName(), LoginAuthenticationFailureHandler.EXPIRED_URL);
    failureUrlMap.put(LockedException.class.getName(), LoginAuthenticationFailureHandler.LOCKED_URL);
    failureUrlMap.put(DisabledException.class.getName(), LoginAuthenticationFailureHandler.DISABLED_URL);
    failureHandler.setExceptionMappings(failureUrlMap);
    return failureHandler;
}
 
开发者ID:helloworldtang,项目名称:sns-todo,代码行数:13,代码来源:FormLoginSecurityConfig.java

示例3: failureHandler

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
protected AuthenticationFailureHandler failureHandler() {
	return new AuthenticationFailureHandler() {
		@Override
		public void onAuthenticationFailure(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException e) throws IOException, ServletException {
			httpServletResponse.getWriter().append("Authentication failure");
			httpServletResponse.setStatus(401);
		}
	};
}
 
开发者ID:vishal1997,项目名称:DiscussionPortal,代码行数:10,代码来源:AuthenticationHandler.java

示例4: AjaxLoginProcessingFilter

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
public AjaxLoginProcessingFilter(String defaultProcessUrl, AuthenticationSuccessHandler successHandler, 
        AuthenticationFailureHandler failureHandler, ObjectMapper mapper) {
    super(defaultProcessUrl);
    this.successHandler = successHandler;
    this.failureHandler = failureHandler;
    this.objectMapper = mapper;
}
 
开发者ID:Apereo-Learning-Analytics-Initiative,项目名称:OpenLRW,代码行数:8,代码来源:AjaxLoginProcessingFilter.java

示例5: AdminUserProcessingFilter

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
public AdminUserProcessingFilter(String defaultProcessUrl, AuthenticationSuccessHandler successHandler,
    AuthenticationFailureHandler failureHandler, ObjectMapper mapper) {
  super(defaultProcessUrl);
  this.successHandler = successHandler;
  this.failureHandler = failureHandler;
  this.objectMapper = mapper;
}
 
开发者ID:Apereo-Learning-Analytics-Initiative,项目名称:OpenLRW,代码行数:8,代码来源:AdminUserProcessingFilter.java

示例6: JwtTokenAuthenticationProcessingFilter

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
@Autowired
public JwtTokenAuthenticationProcessingFilter(AuthenticationFailureHandler failureHandler, 
        TokenExtractor tokenExtractor, RequestMatcher matcher) {
    super(matcher);
    this.failureHandler = failureHandler;
    this.tokenExtractor = tokenExtractor;
}
 
开发者ID:mjfcolas,项目名称:infotaf,代码行数:8,代码来源:JwtTokenAuthenticationProcessingFilter.java

示例7: RefreshTokenProcessingFilter

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
public RefreshTokenProcessingFilter(String defaultProcessUrl, AuthenticationSuccessHandler successHandler,
    AuthenticationFailureHandler failureHandler, ObjectMapper mapper) {
  super(defaultProcessUrl);
  this.successHandler = successHandler;
  this.failureHandler = failureHandler;
  this.objectMapper = mapper;
}
 
开发者ID:osswangxining,项目名称:iotplatform,代码行数:8,代码来源:RefreshTokenProcessingFilter.java

示例8: JwtTokenAuthenticationProcessingFilter

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
@Autowired
public JwtTokenAuthenticationProcessingFilter(AuthenticationFailureHandler failureHandler,
    TokenExtractor tokenExtractor, RequestMatcher matcher) {
  super(matcher);
  this.failureHandler = failureHandler;
  this.tokenExtractor = tokenExtractor;
}
 
开发者ID:osswangxining,项目名称:iotplatform,代码行数:8,代码来源:JwtTokenAuthenticationProcessingFilter.java

示例9: RestPublicLoginProcessingFilter

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
public RestPublicLoginProcessingFilter(String defaultProcessUrl, AuthenticationSuccessHandler successHandler,
    AuthenticationFailureHandler failureHandler, ObjectMapper mapper) {
  super(defaultProcessUrl);
  this.successHandler = successHandler;
  this.failureHandler = failureHandler;
  this.objectMapper = mapper;
}
 
开发者ID:osswangxining,项目名称:iotplatform,代码行数:8,代码来源:RestPublicLoginProcessingFilter.java

示例10: RestLoginProcessingFilter

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
public RestLoginProcessingFilter(String defaultProcessUrl, AuthenticationSuccessHandler successHandler,
    AuthenticationFailureHandler failureHandler, ObjectMapper mapper) {
  super(defaultProcessUrl);
  this.successHandler = successHandler;
  this.failureHandler = failureHandler;
  this.objectMapper = mapper;
}
 
开发者ID:osswangxining,项目名称:iotplatform,代码行数:8,代码来源:RestLoginProcessingFilter.java

示例11: OneTimePasswordFilterConfigurer

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
public OneTimePasswordFilterConfigurer(final String loginProcessingUrl,
                                       AuthenticationSuccessHandler successHandler,
                                       AuthenticationFailureHandler failureHandler,
                                       AuthenticationEntryPoint entryPoint) {
    this.authFilter = new OneTimePasswordAuthenticationFilter(loginProcessingUrl);
    this.authFilter.setRequiresAuthenticationRequestMatcher(new AntPathRequestMatcher(loginProcessingUrl, "POST"));
    this.authFilter.setAuthenticationSuccessHandler(successHandler);
    this.authFilter.setAuthenticationFailureHandler(failureHandler);
    this.authFilter.setAllowSessionCreation(true);
    this.authenticationEntryPoint = entryPoint;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:12,代码来源:OneTimePasswordFilterConfigurer.java

示例12: RefreshTokenProcessingFilter

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
public RefreshTokenProcessingFilter(String defaultProcessUrl, AuthenticationSuccessHandler successHandler,
                                    AuthenticationFailureHandler failureHandler, ObjectMapper mapper) {
    super(defaultProcessUrl);
    this.successHandler = successHandler;
    this.failureHandler = failureHandler;
    this.objectMapper = mapper;
}
 
开发者ID:thingsboard,项目名称:thingsboard,代码行数:8,代码来源:RefreshTokenProcessingFilter.java

示例13: JwtTokenAuthenticationProcessingFilter

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
@Autowired
public JwtTokenAuthenticationProcessingFilter(AuthenticationFailureHandler failureHandler,
                                              TokenExtractor tokenExtractor, RequestMatcher matcher) {
    super(matcher);
    this.failureHandler = failureHandler;
    this.tokenExtractor = tokenExtractor;
}
 
开发者ID:thingsboard,项目名称:thingsboard,代码行数:8,代码来源:JwtTokenAuthenticationProcessingFilter.java

示例14: RestPublicLoginProcessingFilter

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
public RestPublicLoginProcessingFilter(String defaultProcessUrl, AuthenticationSuccessHandler successHandler,
                                 AuthenticationFailureHandler failureHandler, ObjectMapper mapper) {
    super(defaultProcessUrl);
    this.successHandler = successHandler;
    this.failureHandler = failureHandler;
    this.objectMapper = mapper;
}
 
开发者ID:thingsboard,项目名称:thingsboard,代码行数:8,代码来源:RestPublicLoginProcessingFilter.java

示例15: RestLoginProcessingFilter

import org.springframework.security.web.authentication.AuthenticationFailureHandler; //导入依赖的package包/类
public RestLoginProcessingFilter(String defaultProcessUrl, AuthenticationSuccessHandler successHandler,
                                 AuthenticationFailureHandler failureHandler, ObjectMapper mapper) {
    super(defaultProcessUrl);
    this.successHandler = successHandler;
    this.failureHandler = failureHandler;
    this.objectMapper = mapper;
}
 
开发者ID:thingsboard,项目名称:thingsboard,代码行数:8,代码来源:RestLoginProcessingFilter.java


注:本文中的org.springframework.security.web.authentication.AuthenticationFailureHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。