JHipster默认使用Spring Actuator。根据{{3}},我将能够使用类似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呢?
答案 0 :(得分:0)
登录应用程序 - &gt; Administration
- &gt; API
最好注意jHipster tutorial。
答案 1 :(得分:0)
我也使用jhipster,为了能够使用postMan发送请求,我在SecurityConfigurationSaml.java类中更改方法PublicApiWebSecurityConfigurationAdapter。我只需要在我执行请求的链接中添加一个regexMatcher。 我认为链接的安全性是在这个类中编码的。