示例#1
0
 @Override
 protected void configure(HttpSecurity http) throws Exception {
   http.authorizeUrls()
       .antMatchers(
           "/define.kitty",
           "/next_step.kitty",
           "/finale.kitty",
           "/error.kitty",
           "/step/first.kitty")
       .permitAll()
       .antMatchers("/step/finale.kitty")
       .authenticated()
       .anyRequest()
       .authenticated()
       .and()
       .formLogin()
       .loginUrl("/define.kitty")
       .permitAll()
       .loginProcessingUrl("/define.kitty")
       .failureUrl("/error.kitty")
       .usernameParameter("email")
       .passwordParameter("password")
       .successHandler(authenticationSuccessHandler())
       .and()
       .logout()
       .logoutUrl("/undefine.kitty")
       .logoutSuccessUrl("/define.kitty")
       .and()
       .sessionManagement()
       .maximumSessions(1)
       .expiredUrl("/define.kitty");
 }
 @Override
 protected void configure(HttpSecurity http) throws Exception {
   http.authorizeUrls()
       .antMatchers("/")
       .permitAll()
       .antMatchers("/login")
       .permitAll()
       .antMatchers("/logout")
       .permitAll()
       // .anyRequest().authenticated()
       .anyRequest()
       .permitAll()
       .and()
       .logout()
       .deleteCookies()
       .invalidateHttpSession(true)
       .logoutUrl("/logout")
       .logoutSuccessUrl("/");
 }