私のconfigure(HttpSecurity)には次のものがあります:
.antMatchers("/api/account/reset-password/finish").hasAnyAuthority(AuthoritiesConstants.BANK, AuthoritiesConstants.USER)
そして、この特定のエンドポイントでは:
public void finishPasswordReset(@RequestBody KeyAndPasswordVM keyAndPassword)
私は上に置きます:
@PreAuthorize("hasAnyAuthority(\""+AuthoritiesConstants.BANK+"\", \""+AuthoritiesConstants.USER+"\")")
しかし、ポストマンを使用してロール「ROLE_ADMIN」(権限のないユーザー)を持つ管理者ユーザーでテストすると、403 はなく、リクエストは正常に渡されました。
情報:
AuthoritiesConstants.USER = "ROLE_USER";
AuthoritiesConstants.BANK = "ROLE_BANK";
AuthoritiesConstants.ADMIN = "ROLE_ADMIN";