@Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException { validateLogin(request); validatePassword(request); return super.attemptAuthentication(request, response); }
request.getHeader("accept").contains(MediaType.APPLICATION_FORM_URLENCODED_VALUE) || (request.getContentType() != null && request.getContentType().contains(MediaType.APPLICATION_FORM_URLENCODED_VALUE))) { return super.attemptAuthentication(request, response);
request.getHeader("accept").contains(MediaType.APPLICATION_FORM_URLENCODED_VALUE) || (request.getContentType() != null && request.getContentType().contains(MediaType.APPLICATION_FORM_URLENCODED_VALUE))) { return super.attemptAuthentication(request, response);
@Override public Authentication attemptAuthentication( javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws AuthenticationException { final String autoLoginToken = request.getParameter("autoLoginToken"); if (autoLoginToken !=null) { final Guest one = jpaDaoService.findOne("guest.byAutoLoginToken", Guest.class, autoLoginToken); if (one!=null) { if ((System.currentTimeMillis()-one.autoLoginTokenTimestamp)>60000) { throw new RuntimeException("Token is too old!"); } final FlxUserDetails details = new FlxUserDetails(one); final UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(details, one.password, getAuthorities(one)); authRequest.setDetails(details); jpaDaoService.execute("UPDATE Guest SET autoLoginToken=null WHERE autoLoginToken='" + autoLoginToken + "'"); return authRequest; } else throw new RuntimeException("No such autologin token: " + autoLoginToken); } Authentication authentication = null; try { authentication = super.attemptAuthentication(request, response);} catch (AuthenticationException failed) { authentication = attemptAuthenticationWithEmailAddress(request); } return authentication; }
auth = super.attemptAuthentication(request, response);