【发布时间】:2020-07-04 00:19:13
【问题描述】:
我正在尝试将 Spring Authorization Server 与 Spring Cloud Gateway 一起使用,但我一直无法获取用户信息。我可以在网关日志中看到类似
的消息[2020-03-23 13:36:35,061] TRACE org.springframework.web.HttpLogging - [45961b04] Decoded [{access_token=5b5a13f1-2b47-4739-bda2-74785f6e3828, token_type=bearer, expires_in=33556, scope=read}]
这意味着授权工作正常,但在 302 FOUND Location: /res (protected resource) 之后它会将我转发回授权服务器。
完整代码在此处的演示项目中:https://github.com/looksworking/gw-oauth
授权服务器:
Spring Cloud 网关:
非常感谢任何帮助。
【问题讨论】:
标签: spring spring-security oauth spring-security-oauth2 spring-cloud-gateway