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 58
58
import org .springframework .security .web .authentication .SimpleUrlAuthenticationFailureHandler ;
59
59
import org .springframework .security .web .authentication .SimpleUrlAuthenticationSuccessHandler ;
60
60
import org .springframework .security .web .authentication .WebAuthenticationDetailsSource ;
61
+ import org .springframework .security .web .context .HttpSessionSecurityContextRepository ;
61
62
import org .springframework .security .web .context .RequestAttributeSecurityContextRepository ;
62
63
import org .springframework .security .web .context .SecurityContextRepository ;
63
64
import org .springframework .security .web .util .UrlUtils ;
@@ -144,7 +145,7 @@ public class SwitchUserFilter extends GenericFilterBean implements ApplicationEv
144
145
145
146
private AuthenticationFailureHandler failureHandler ;
146
147
147
- private SecurityContextRepository securityContextRepository = new RequestAttributeSecurityContextRepository ();
148
+ private SecurityContextRepository securityContextRepository = new HttpSessionSecurityContextRepository ();
148
149
149
150
@ Override
150
151
public void afterPropertiesSet () {
Original file line number Diff line number Diff line change 47
47
import org .springframework .security .util .FieldUtils ;
48
48
import org .springframework .security .web .DefaultRedirectStrategy ;
49
49
import org .springframework .security .web .authentication .SimpleUrlAuthenticationSuccessHandler ;
50
- import org .springframework .security .web .context .RequestAttributeSecurityContextRepository ;
50
+ import org .springframework .security .web .context .HttpSessionSecurityContextRepository ;
51
51
import org .springframework .security .web .context .SecurityContextRepository ;
52
52
import org .springframework .security .web .util .matcher .AnyRequestMatcher ;
53
53
import org .springframework .test .util .ReflectionTestUtils ;
@@ -491,10 +491,10 @@ public void setSwitchFailureUrlWhenValidThenNoException() {
491
491
}
492
492
493
493
@ Test
494
- void filterWhenDefaultSecurityContextRepositoryThenRequestAttributeRepository () {
494
+ void filterWhenDefaultSecurityContextRepositoryThenHttpSessionRepository () {
495
495
SwitchUserFilter switchUserFilter = new SwitchUserFilter ();
496
496
assertThat (ReflectionTestUtils .getField (switchUserFilter , "securityContextRepository" ))
497
- .isInstanceOf (RequestAttributeSecurityContextRepository .class );
497
+ .isInstanceOf (HttpSessionSecurityContextRepository .class );
498
498
}
499
499
500
500
@ Test
You can’t perform that action at this time.
0 commit comments