use of com.evolveum.midpoint.authentication.impl.MidpointSecurityContext in project midpoint by Evolveum.
the class MidpointWebSecurityConfigurerAdapter method createSessionContextRepository.
private void createSessionContextRepository(HttpSecurity http) {
HttpSessionSecurityContextRepository httpSecurityRepository = new HttpSessionSecurityContextRepository() {
@Override
public void saveContext(SecurityContext context, HttpServletRequest request, HttpServletResponse response) {
if (!AuthSequenceUtil.isRecordSessionLessAccessChannel(request)) {
super.saveContext(context, request, response);
}
}
@Override
protected SecurityContext generateNewContext() {
return new MidpointSecurityContext(super.generateNewContext(), removeUnusedSecurityFilterPublisher);
}
};
httpSecurityRepository.setDisableUrlRewriting(true);
AuthenticationTrustResolver trustResolver = http.getSharedObject(AuthenticationTrustResolver.class);
if (trustResolver != null) {
httpSecurityRepository.setTrustResolver(trustResolver);
}
http.setSharedObject(SecurityContextRepository.class, httpSecurityRepository);
}
Aggregations