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 49
49
import org .springframework .security .util .FieldUtils ;
50
50
import org .springframework .security .web .DefaultRedirectStrategy ;
51
51
import org .springframework .security .web .authentication .SimpleUrlAuthenticationSuccessHandler ;
52
- import org .springframework .security .web .context .RequestAttributeSecurityContextRepository ;
52
+ import org .springframework .security .web .context .HttpSessionSecurityContextRepository ;
53
53
import org .springframework .security .web .context .SecurityContextRepository ;
54
54
import org .springframework .security .web .util .matcher .AnyRequestMatcher ;
55
55
import org .springframework .test .util .ReflectionTestUtils ;
@@ -510,10 +510,10 @@ public void setSwitchFailureUrlWhenValidThenNoException() {
510
510
}
511
511
512
512
@ Test
513
- void filterWhenDefaultSecurityContextRepositoryThenRequestAttributeRepository () {
513
+ void filterWhenDefaultSecurityContextRepositoryThenHttpSessionRepository () {
514
514
SwitchUserFilter switchUserFilter = new SwitchUserFilter ();
515
515
assertThat (ReflectionTestUtils .getField (switchUserFilter , "securityContextRepository" ))
516
- .isInstanceOf (RequestAttributeSecurityContextRepository .class );
516
+ .isInstanceOf (HttpSessionSecurityContextRepository .class );
517
517
}
518
518
519
519
@ Test
You can’t perform that action at this time.
0 commit comments