gpt4 book ai didi

java - 更新到 Spring Boot 1.5.8 和 Finchley/Edgware Spring Cloud 后出现 Feign 异常 403

转载 作者:行者123 更新时间:2023-12-01 20:06:47 25 4
gpt4 key购买 nike

我对微服务比较陌生,我一直在尝试使用这个 proof-of-concept application使用 Spring BootSpring Cloud

问题是,虽然该应用程序在 Spring Boot 1.3.5Spring Cloud Brixton.RELEASE 上运行良好,但在升级其中任何一个时都会崩溃。

注册新帐户时发生错误,并给出以下错误:

status 403 reading AuthServiceClient#createUser(User); content:↵{"timestamp":1510753211255,"status":403,"error":"Forbidden","message":"Access Denied","path":"/uaa/users"}

以及堆栈跟踪:

2017-11-15 15:40:11.284 ERROR 9072 --- [nio-6000-exec-1] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/accounts] threw exception [Request processing failed; nested exception is feign.FeignException: status 403 reading AuthServiceClient#createUser(User); content: {"timestamp":1510753211255,"status":403,"error":"Forbidden","message":"Access Denied","path":"/uaa/users"}] with root cause

由于这似乎是一个 Feign 错误,而 AuthServiceClient.java 似乎是罪魁祸首,因此我将其包含在此处:

@FeignClient(name = "auth-service")
public interface AuthServiceClient {

@RequestMapping(method = RequestMethod.POST, value = "/uaa/users", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
void createUser(User user);

}

由于代码没有任何更改,我不明白原因可能是什么以及如何修复此错误。

最佳答案

显然有这个神奇的属性让它再次发挥作用:

security.oauth2.resource.filter-order: 3 

auth-service.properties

这里进一步阅读: SpringBoot 1.5.x + Security + OAuth2

关于java - 更新到 Spring Boot 1.5.8 和 Finchley/Edgware Spring Cloud 后出现 Feign 异常 403,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47335582/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com