【发布时间】:2015-10-09 23:49:24
【问题描述】:
JHipster 默认带有 Spring Actuator。根据the document,我将能够使用类似 localhost/api 的 url 查看应用程序 Rest API。但是,即使我以管理员身份登录,当我尝试访问它时,由于“未授权(未授权)”而得到“访问被拒绝”。在 SecurityConfiguration 类中,我更改了以下方法
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring()
.antMatchers("/scripts/**/*.{js,html}")
.antMatchers("/bower_components/**")
.antMatchers("/i18n/**")
.antMatchers("/assets/**")
.antMatchers("/swagger-ui.html")
.antMatchers("/api/**") <-- new added
.antMatchers("/api/register")
.antMatchers("/api/activate")
.antMatchers("/api/account/reset_password/init")
.antMatchers("/api/account/reset_password/finish")
.antMatchers("/test/**");
}
此更改只会产生异常。
那我怎样才能访问我的应用程序 Rest API?
【问题讨论】:
-
你试过看代码吗?
标签: jhipster