Ok, I've found the solution: I needed to add a securityListener manually.
Before startFlow
:
setFlowExecutionListener(getSecurityListener(new String[] {"ROLE_ADMIN_FAKE"}));
Where
private FlowExecutionListener getSecurityListener(String[] roles) {
List<GrantedAuthority> result = new ArrayList<>();
for (String role: roles) {
SimpleGrantedAuthority authority = new SimpleGrantedAuthority(role);
result.add(authority);
}
Authentication auth = new PreAuthenticatedAuthenticationToken("Igor", "", result);
SecurityContextHolder.getContext().setAuthentication(auth);
return new SecurityFlowExecutionListener();
}