Spring Security 无法从jhipster应用程序中的控制器访问链接

vh0rcniy  于 5个月前  发布在  Spring
关注(0)|答案(1)|浏览(82)

我正在使用jhipster并创建了一个测试控制器来查看我的应用程序是否正常工作
你可以在下面看到我的控制器:

@RestController
@Configuration
public class TestController {

    private static final Logger log = LoggerFactory.getLogger(TestController.class);

    @GetMapping("/test/github")
    public String testEndpoint() {
        log.info("Test endpoint called");
        return "Test endpoint response";
    }
}

字符串
在我的SecurityConfiguration文件中,我包含了以下行:.requestMatchers(mvc.pattern("/test/github")).permitAll()
当我访问http://localhost:8080/test/github时,我立即被重新定义为http://localhost:8080/not-found页面
不知道我错过了什么!

uqzxnwby

uqzxnwby1#

您需要向项目的SpaWebFilter添加一个新条件。

相关问题