File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
config/src/main/java/org/springframework/security/config/http Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -600,6 +600,7 @@ private void createServletApiFilter(BeanReference authenticationManager) {
600
600
this .servApiFilter = GrantedAuthorityDefaultsParserUtils .registerWithDefaultRolePrefix (this .pc ,
601
601
SecurityContextHolderAwareRequestFilterBeanFactory .class );
602
602
this .servApiFilter .getPropertyValues ().add ("authenticationManager" , authenticationManager );
603
+ this .servApiFilter .getPropertyValues ().add ("securityContextHolderStrategy" , this .holderStrategyRef );
603
604
}
604
605
}
605
606
@@ -902,12 +903,20 @@ static class SecurityContextHolderAwareRequestFilterBeanFactory
902
903
903
904
private SecurityContextHolderAwareRequestFilter filter = new SecurityContextHolderAwareRequestFilter ();
904
905
906
+ private SecurityContextHolderStrategy securityContextHolderStrategy = SecurityContextHolder
907
+ .getContextHolderStrategy ();
908
+
905
909
@ Override
906
910
public SecurityContextHolderAwareRequestFilter getBean () {
911
+ this .filter .setSecurityContextHolderStrategy (this .securityContextHolderStrategy );
907
912
this .filter .setRolePrefix (this .rolePrefix );
908
913
return this .filter ;
909
914
}
910
915
916
+ void setSecurityContextHolderStrategy (SecurityContextHolderStrategy securityContextHolderStrategy ) {
917
+ this .securityContextHolderStrategy = securityContextHolderStrategy ;
918
+ }
919
+
911
920
}
912
921
913
922
static class SecurityContextHolderStrategyFactory implements FactoryBean <SecurityContextHolderStrategy > {
You can’t perform that action at this time.
0 commit comments