You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Java Spring Security认证服务器无详细错误描述的调试诉求

问题:Spring OAuth2认证服务器无法获取详细错误调试信息

Java Spring认证与授权服务器可正常启动运行,但在执行OAuth2授权流程时,客户端向/oauth2/authorize发送请求后,无法获取具备调试价值的详细错误信息,难以排查问题。

请求示例

客户端发送的授权请求如下:

https://MY_DOMAIN/authorize?
    response_type=code&
    client_id=MY_CLIENT_ID&
    redirect_uri=MY_CALLBACK_URL&
    scope=SCOPE&
    state=STATE

错误表现

输入用户凭据后,仅返回无详细内容的错误页面(见截图);服务器控制台输出也仅包含无有效调试价值的日志,示例片段如下:

...
2022-08-15 15:52:33.739 DEBUG 50827 --- [nio-9000-exec-4] s.s.w.c.SecurityContextPersistenceFilter : Cleared SecurityContextHolder to complete request
2022-08-15 15:52:33.739 DEBUG 50827 --- [nio-9000-exec-4] o.a.c.c.C.[Tomcat].[localhost]           : Processing ErrorPage[errorCode=0, location=/error]
2022-08-15 15:52:33.739 DEBUG 50827 --- [nio-9000-exec-4] o.s.security.web.FilterChainProxy        : Securing GET /error?protocol=oauth2&response_type=code&access_type&client_id=articles-client&redirect_uri=http%3A%2F%2F127.0.0.1%3A3000%2Flms%2Flogin&scope=openid%20articles.read&state=XqqDv6wx6O&code_challenge_method=plain&code_challenge=e964fe0c4b609ef3cf29658efc6077e7feb591f78c458c2092aa56c9
...

需求

无需解决当前具体错误,仅需配置或调整服务器,使其返回更具信息量的错误提示,以便调试各类同类OAuth2流程问题。


内容的提问来源于stack exchange,提问作者drh0use

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.22 14:06:24