oAuth 2 clients may break with SpringBoot 3

未关闭
#93 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
22/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
java, spring-boot

调研方向

The mapping from the ProvisionedService ClientAuthenticationMethod field to spring.security.oauth2.client.registration.[registrationId].client-authentication-method happens in the spring-cloud-bindings library, so start there where the string is converted to a ClientAuthenticationMethod. Reproduce with a Spring Boot 3 app that uses a deprecated value such as basic or post and confirm the OAuth2 callback fails. Done means legacy values resolve to valid Spring Security instances without changing the shared ProvisionedService for other apps; the issue thread has no agreed fix, so check with maintainers first.

由索引模型根据 Issue 内容生成。

描述

Depending on the value set by an oAuth2 ProvisionedService for the ClientAuthenticationMethod field, SpringBoot 3 apps may break when acting as an oAuth2 client. The value of this field gets mapped verbatim to the Spring spring.security.oauth2.client.registration.[registrationId].client-authentication-method property via the spring-cloud-bindings library when using service binding.

Internally, this value gets converted to a ClientAuthenticationMethod instance. This works fine for SpringBoot 2.7.x and below as the class maps the following Strings to defaulted instances (Note: the values allowed in the ClientRegistration resource are deprecated):

	@Deprecated
	public static final ClientAuthenticationMethod BASIC = new ClientAuthenticationMethod("basic");
	public static final ClientAuthenticationMethod CLIENT_SECRET_BASIC = new ClientAuthenticationMethod(
			"client_secret_basic");
	@Deprecated
	public static final ClientAuthenticationMethod POST = new ClientAuthenticationMethod("post");
	public static final ClientAuthenticationMethod CLIENT_SECRET_POST = new ClientAuthenticationMethod(
			"client_secret_post");
	public static final ClientAuthenticationMethod CLIENT_SECRET_JWT = new ClientAuthenticationMethod(
			"client_secret_jwt");
	public static final ClientAuthenticationMethod PRIVATE_KEY_JWT = new ClientAuthenticationMethod("private_key_jwt");
	public static final ClientAuthenticationMethod NONE = new ClientAuthenticationMethod("none");

In boot 3, the deprecated fields are no longer available meaning the clientAuthenticationMethod does not map to valid instance if the deprecated values are used for ClientAuthenticationMethod field of the ProvisionedService. This is causing the oAuth2 process to fail when the AuthServer is redirected back to the application's callback URL.

Simply asking a ProvisionedService to update the value of this field may break other apps that are depending on the same ProvisionedService instance.

主要语言
Java
星标
50
派生
33
平均合并
6 天 2 小时
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

spring-cloud/spring-cloud-bindings 的其他 Issue

查看 spring-cloud/spring-cloud-bindings 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。