Spring安全反应-如何调试无效凭据错误? [英] spring security reactive - how to debug "invalid credentials" error?

查看:20
本文介绍了Spring安全反应-如何调试无效凭据错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在我的反应式Spring Boot应用程序中使用外部OAuth提供程序对用户进行身份验证。

遵循the official tutorial,我使用预配置的提供者(Google、Github等)成功地实现了该流。将配置更改为非预配置 提供程序可以使用these properties完成,例如:

spring.security.oauth2.client.registration.<providerName>.client-id=<clientId>
spring.security.oauth2.client.registration.<providerName>.client-secret=<clientSecret>
spring.security.oauth2.client.registration.<providerName>.redirect-uri={baseUrl}/login/oauth2/code/<providerName>
spring.security.oauth2.client.registration.<providerName>.provider=<providerName>
spring.security.oauth2.client.registration.<providerName>.client-authentication-method=basic
spring.security.oauth2.client.registration.<providerName>.authorization-grant-type=authorization_code

spring.security.oauth2.client.provider.<providerName>.authorization-uri=https://api.<providerName>.com/authorize
spring.security.oauth2.client.provider.<providerName>.token-uri=https://api.<providerName>.com/token

使用此设置,将向用户提示登录页面,并使用authCode

调用指定的重定向URL

但是,返回此错误页面,控制台中没有日志条目或异常(即使我设置了logging.level.org.springframework.security=DEBUG属性)。

可能是什么问题?我可以从哪里开始调试?

推荐答案

AuthenticationWebFilter.authenticate是调试它的地方。在我的情况下,user-info-uri属性缺失

这篇关于Spring安全反应-如何调试无效凭据错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆