Skip to content

Commit 610bb05

Browse files
Doha2012Eugen
authored andcommitted
minor fix (eugenp#2334)
* minor logging fix * spring security sso * use basic auth * use form login * cleanup * cleanup * final cleanup * second client app for sso * spring boot bootstrap * add logic * cleanup * add simple controller * add thymeleaf and security * minor fix * minor fix * add more boot properties * fix live test * fix live test * minor fix * semaphores * fix configuration * kotlin collection * add more collection examples * minor upgrade * cucumber java8 * minor fix
1 parent 4441d96 commit 610bb05

1 file changed

Lines changed: 16 additions & 21 deletions

File tree

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
package org.baeldung.spring;
22

3-
import org.springframework.context.annotation.Configuration;
4-
import org.springframework.context.annotation.Profile;
53
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
64
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
7-
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
85
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
96
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
107

11-
@Configuration
8+
//@Configuration
129
//@ImportResource({ "classpath:RedirectionWebSecurityConfig.xml" })
13-
@EnableWebSecurity
14-
@Profile("!https")
10+
//@EnableWebSecurity
11+
//@Profile("!https")
1512
public class RedirectionSecurityConfig extends WebSecurityConfigurerAdapter {
1613

1714
public RedirectionSecurityConfig() {
@@ -20,25 +17,23 @@ public RedirectionSecurityConfig() {
2017

2118
@Override
2219
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
23-
auth
24-
.inMemoryAuthentication()
25-
.withUser("user1")
26-
.password("user1Pass")
27-
.roles("USER");
20+
auth.inMemoryAuthentication()
21+
.withUser("user1")
22+
.password("user1Pass")
23+
.roles("USER");
2824
}
2925

3026
@Override
3127
protected void configure(final HttpSecurity http) throws Exception {
32-
http
33-
.authorizeRequests()
34-
.antMatchers("/login*")
35-
.permitAll()
36-
.anyRequest()
37-
.authenticated()
38-
.and()
39-
.formLogin()
40-
.successHandler(new SavedRequestAwareAuthenticationSuccessHandler());
41-
//.successHandler(new RefererAuthenticationSuccessHandler())
28+
http.authorizeRequests()
29+
.antMatchers("/login*")
30+
.permitAll()
31+
.anyRequest()
32+
.authenticated()
33+
.and()
34+
.formLogin()
35+
.successHandler(new SavedRequestAwareAuthenticationSuccessHandler());
36+
// .successHandler(new RefererAuthenticationSuccessHandler())
4237
}
4338

4439
}

0 commit comments

Comments
 (0)