File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
main/java/org/springframework/security/web/authentication/switchuser
test/java/org/springframework/security/web/authentication/switchuser Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 59
59
import org .springframework .security .web .authentication .SimpleUrlAuthenticationFailureHandler ;
60
60
import org .springframework .security .web .authentication .SimpleUrlAuthenticationSuccessHandler ;
61
61
import org .springframework .security .web .authentication .WebAuthenticationDetailsSource ;
62
+ import org .springframework .security .web .context .HttpSessionSecurityContextRepository ;
62
63
import org .springframework .security .web .context .RequestAttributeSecurityContextRepository ;
63
64
import org .springframework .security .web .context .SecurityContextRepository ;
64
65
import org .springframework .security .web .util .UrlUtils ;
@@ -148,7 +149,7 @@ public class SwitchUserFilter extends GenericFilterBean implements ApplicationEv
148
149
149
150
private AuthenticationFailureHandler failureHandler ;
150
151
151
- private SecurityContextRepository securityContextRepository = new RequestAttributeSecurityContextRepository ();
152
+ private SecurityContextRepository securityContextRepository = new HttpSessionSecurityContextRepository ();
152
153
153
154
@ Override
154
155
public void afterPropertiesSet () {
Original file line number Diff line number Diff line change 50
50
import org .springframework .security .util .FieldUtils ;
51
51
import org .springframework .security .web .DefaultRedirectStrategy ;
52
52
import org .springframework .security .web .authentication .SimpleUrlAuthenticationSuccessHandler ;
53
- import org .springframework .security .web .context .RequestAttributeSecurityContextRepository ;
53
+ import org .springframework .security .web .context .HttpSessionSecurityContextRepository ;
54
54
import org .springframework .security .web .context .SecurityContextRepository ;
55
55
import org .springframework .security .web .util .matcher .AnyRequestMatcher ;
56
56
import org .springframework .test .util .ReflectionTestUtils ;
@@ -511,10 +511,10 @@ public void setSwitchFailureUrlWhenValidThenNoException() {
511
511
}
512
512
513
513
@ Test
514
- void filterWhenDefaultSecurityContextRepositoryThenRequestAttributeRepository () {
514
+ void filterWhenDefaultSecurityContextRepositoryThenHttpSessionRepository () {
515
515
SwitchUserFilter switchUserFilter = new SwitchUserFilter ();
516
516
assertThat (ReflectionTestUtils .getField (switchUserFilter , "securityContextRepository" ))
517
- .isInstanceOf (RequestAttributeSecurityContextRepository .class );
517
+ .isInstanceOf (HttpSessionSecurityContextRepository .class );
518
518
}
519
519
520
520
@ Test
You can’t perform that action at this time.
0 commit comments