Last active
August 29, 2015 13:56
-
-
Save altfatterz/9152772 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void configure(HttpSecurity http) throws Exception { | |
http.authorizeRequests() | |
.antMatchers("/signup", "/static/**").permitAll() | |
.antMatchers("/code").hasRole("PRE_AUTH_USER") | |
.antMatchers("/home").hasRole("USER") | |
.anyRequest().authenticated(); | |
http.formLogin() | |
.loginPage("/login") | |
.permitAll() | |
// always use the default success url despite if a protected page had been previously visited | |
.defaultSuccessUrl("/code", true) | |
.and() | |
.logout() | |
.permitAll(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment