Package org.springframework.security

Examples of org.springframework.security.AuthenticationException


            String access_error,
            @RequestParam(value = "login_error", required = false)
            String login_error, ModelMap map)
            throws InfrastructureException {

        AuthenticationException authExcept = (AuthenticationException) req
                .getSession()
                .getAttribute(
                        AbstractProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY);

        // parameter may be on param line if we're redirect:ed here
        // (createUserController)
        map.addAttribute("message", req.getParameter("message"));
       
        if (authExcept != null) {
            String message = authExcept.getMessage();
            log.info("Login Error " + message + " uname: "
                    + req.getParameter("j_username"));
            map.addAttribute("login_error", message);
        }
        if (access_error != null) {
View Full Code Here


    /** Test commence(). */
    @Test public void testCommence() throws Exception {
        ServletRequest request = mock(ServletRequest.class);
        ServletResponse response = mock(ServletResponse.class);
        AuthenticationException exception = mock(AuthenticationException.class);
        GaeAuthenticationEntryPoint entryPoint = new GaeAuthenticationEntryPoint();
        entryPoint.commence(request, response, exception)// just make sure it runs (it's a no-op)
    }
View Full Code Here

    HttpSession session = req.getSession(false);
    assert session != null;
    String msg = "";
    boolean loginError = (req.getParameter("login_error") != null);
    if(loginError) {
      AuthenticationException ae = (AuthenticationException) session
          .getAttribute(AbstractProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY);
      if(ae != null) {
        // failed login (get error message)
        msg = ae.getMessage();
      }
    }
    resp.setContentType("text/html");
    resp.getWriter().write(msg);
  }
View Full Code Here

TOP

Related Classes of org.springframework.security.AuthenticationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.