Java 类org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler 实例源码

项目:sshd-shell-spring-boot    文件:MySecurityConfig.java   
@Override
protected void configure(HttpSecurity http) throws Exception {
    SimpleUrlAuthenticationSuccessHandler authSuccessHandler = new SimpleUrlAuthenticationSuccessHandler();
    authSuccessHandler.setUseReferer(true);
    http.authorizeRequests()
            .antMatchers("/login").permitAll()
            .anyRequest().authenticated()
            .and().formLogin().defaultSuccessUrl("/test", true);
}
项目:judge    文件:SecurityConfiguration.java   
@Override
protected void configure(HttpSecurity http) throws Exception {
    SimpleUrlAuthenticationSuccessHandler simpleUrlAuthenticationSuccessHandler = new SimpleUrlAuthenticationSuccessHandler("/");
    simpleUrlAuthenticationSuccessHandler.setUseReferer(false);
    simpleUrlAuthenticationSuccessHandler.setTargetUrlParameter("url");
    DefaultRedirectStrategy defaultRedirectStrategy = new DefaultRedirectStrategy();

    simpleUrlAuthenticationSuccessHandler.setRedirectStrategy(defaultRedirectStrategy);

    SimpleUrlLogoutSuccessHandler simpleUrlLogoutSuccessHandler = new SimpleUrlLogoutSuccessHandler();
    simpleUrlLogoutSuccessHandler.setUseReferer(true);

    // @formatter:off
    http
        .authorizeRequests()
            .antMatchers(ckfinder.getServlet().getPath()).hasAnyRole("ADMIN")
            .and()
        .csrf()
            .disable()
        .exceptionHandling()
            .authenticationEntryPoint(authenticationEntryPoint())
            .and()
        .formLogin()
            .loginPage("/login")
            .usernameParameter("user_id1")
            .passwordParameter("password1")
            .successHandler(simpleUrlAuthenticationSuccessHandler)
            .failureHandler(failureHandler())
            .permitAll()
            .and()
        .headers()
            .cacheControl().disable()
            .httpStrictTransportSecurity().disable()
            .frameOptions().sameOrigin()
            .and()
        .logout()
            .logoutUrl("/logout.html")
            .logoutSuccessHandler(simpleUrlLogoutSuccessHandler)
            .permitAll()
            .and()
        .rememberMe()
            .rememberMeParameter("rememberMe")
            .tokenRepository(persistentTokenRepository)
            .and()
        .requestCache()
            .requestCache(new NullRequestCache())
            .and()
        .servletApi();
    // @formatter:on
}
项目:one-decision    文件:TestApplication.java   
private AuthenticationSuccessHandler getSuccessHandler() {
    SimpleUrlAuthenticationSuccessHandler successHandler = new SimpleUrlAuthenticationSuccessHandler(
            "/");
    successHandler.setTargetUrlParameter("redirect");
    return successHandler;
}
项目:artifact-listener    文件:MavenArtifactNotifierWebappSecurityConfig.java   
@Bean
public SimpleUrlAuthenticationSuccessHandler pac4jAuthenticationSuccessHandler() {
    return new Pac4jAuthenticationSuccessHandler();
}