In my configure(HttpSecurity) I have :
.antMatchers("/api/account/reset-password/finish").hasAnyAuthority(AuthoritiesConstants.BANK, AuthoritiesConstants.USER)
And in this particular endpoint :
public void finishPasswordReset(@RequestBody KeyAndPasswordVM keyAndPassword)
I put above :
@PreAuthorize("hasAnyAuthority(\""+AuthoritiesConstants.BANK+"\", \""+AuthoritiesConstants.USER+"\")")
But when I test it with and admin user with a role "ROLE_ADMIN" (who's not authorized) using postman, there's not a 403 and the request passed normally.
Information:
AuthoritiesConstants.USER = "ROLE_USER";
AuthoritiesConstants.BANK = "ROLE_BANK";
AuthoritiesConstants.ADMIN = "ROLE_ADMIN";