Package org.springframework.security.web.authentication

Examples of org.springframework.security.web.authentication.AuthenticationSuccessHandler


        assertNull(filter.attemptAuthentication(request, response));
    }

    @Test
    public void testDoFilterAuthenticateAll() throws Exception {
        AuthenticationSuccessHandler successHandler = mock(AuthenticationSuccessHandler.class);
        AuthenticationManager manager = mock(AuthenticationManager.class);
        Authentication authentication = new TestingAuthenticationToken("un", "pwd","ROLE_USER");
        when(manager.authenticate(any(Authentication.class))).thenReturn(authentication);
        ServiceProperties serviceProperties = new ServiceProperties();
        serviceProperties.setAuthenticateAllArtifacts(true);
View Full Code Here


          exception = new BadCredentialsException(exception.getMessage(), new BadClientCredentialsException());
        }
        authenticationEntryPoint.commence(request, response, exception);
      }
    });
    setAuthenticationSuccessHandler(new AuthenticationSuccessHandler() {
      public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
          Authentication authentication) throws IOException, ServletException {
        // no-op - just allow filter chain to continue to token endpoint
      }
    });
View Full Code Here

  public void setUpdateConnections(boolean updateConnections) {
    this.updateConnections = updateConnections;
  }

  public void setPostLoginUrl(String postLoginUrl) {
    AuthenticationSuccessHandler successHandler = getSuccessHandler();
    if (successHandler instanceof AbstractAuthenticationTargetUrlRequestHandler) {
      AbstractAuthenticationTargetUrlRequestHandler h = (AbstractAuthenticationTargetUrlRequestHandler) successHandler;
      h.setDefaultTargetUrl(postLoginUrl);
    } else {
      throw new IllegalStateException("can't set postLoginUrl on unknown successHandler, type is " + successHandler.getClass().getName());
    }
  }
View Full Code Here

      throw new IllegalStateException("can't set postLoginUrl on unknown successHandler, type is " + successHandler.getClass().getName());
    }
  }

  public void setAlwaysUsePostLoginUrl(boolean alwaysUsePostLoginUrl) {
    AuthenticationSuccessHandler successHandler = getSuccessHandler();
    if (successHandler instanceof AbstractAuthenticationTargetUrlRequestHandler) {
      AbstractAuthenticationTargetUrlRequestHandler h = (AbstractAuthenticationTargetUrlRequestHandler) successHandler;
      h.setAlwaysUseDefaultTargetUrl(alwaysUsePostLoginUrl);
    } else {
      throw new IllegalStateException("can't set alwaysUsePostLoginUrl on unknown successHandler, type is " + successHandler.getClass().getName());
    }
  }
View Full Code Here

  public void setUpdateConnections(boolean updateConnections) {
    this.updateConnections = updateConnections;
  }

  public void setPostLoginUrl(String postLoginUrl) {
    AuthenticationSuccessHandler successHandler = getSuccessHandler();
    if (successHandler instanceof AbstractAuthenticationTargetUrlRequestHandler) {
      AbstractAuthenticationTargetUrlRequestHandler h = (AbstractAuthenticationTargetUrlRequestHandler) successHandler;
      h.setDefaultTargetUrl(postLoginUrl);
    } else {
      throw new IllegalStateException("can't set postLoginUrl on unknown successHandler, type is " + successHandler.getClass().getName());
    }
  }
View Full Code Here

      throw new IllegalStateException("can't set postLoginUrl on unknown successHandler, type is " + successHandler.getClass().getName());
    }
  }

  public void setAlwaysUsePostLoginUrl(boolean alwaysUsePostLoginUrl) {
    AuthenticationSuccessHandler successHandler = getSuccessHandler();
    if (successHandler instanceof AbstractAuthenticationTargetUrlRequestHandler) {
      AbstractAuthenticationTargetUrlRequestHandler h = (AbstractAuthenticationTargetUrlRequestHandler) successHandler;
      h.setAlwaysUseDefaultTargetUrl(alwaysUsePostLoginUrl);
    } else {
      throw new IllegalStateException("can't set alwaysUsePostLoginUrl on unknown successHandler, type is " + successHandler.getClass().getName());
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.security.web.authentication.AuthenticationSuccessHandler

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.