修复redirect_uri参数兼容性问题 修正了当redirect_uri为空时,优先从请求参数"redirect_url"获取回调地址,以兼容部分第三方客户端使用不同参数名的情况,提升了系统的兼容性和健壮性。大石头 authored at 2026-03-25 18:50:12
diff --git a/NewLife.Cube/Controllers/SsoController.cs b/NewLife.Cube/Controllers/SsoController.cs
index 01c8714..f31a1b1 100644
--- a/NewLife.Cube/Controllers/SsoController.cs
+++ b/NewLife.Cube/Controllers/SsoController.cs
@@ -600,6 +600,8 @@ public class SsoController : ControllerBaseX
// 参数不完整时,跳转到登录页面,避免爬虫抓取而导致误报告警
if (client_id.IsNullOrEmpty()) return Redirect(loginUrl ?? Provider.LoginUrl);
+ //有些第三方客户端使用redirect_url作为回调地址参数名
+ if (redirect_uri.IsNullOrEmpty()) redirect_uri = GetRequest("redirect_url");
//if (client_id.IsNullOrEmpty()) throw new ArgumentNullException(nameof(client_id));
if (redirect_uri.IsNullOrEmpty()) throw new ArgumentNullException(nameof(redirect_uri));
if (response_type.IsNullOrEmpty()) response_type = "code";
diff --git a/NewLife.CubeNC/Controllers/SsoController.cs b/NewLife.CubeNC/Controllers/SsoController.cs
index e11e85a..2127204 100644
--- a/NewLife.CubeNC/Controllers/SsoController.cs
+++ b/NewLife.CubeNC/Controllers/SsoController.cs
@@ -447,7 +447,7 @@ public class SsoController : ControllerBaseX
//if (client_id.IsNullOrEmpty()) throw new ArgumentNullException(nameof(client_id));
//有些第三方客户端使用redirect_url作为回调地址参数名
- if (redirect_uri.IsNullOrEmpty()) redirect_uri = GetRequest("redirect_uri");
+ if (redirect_uri.IsNullOrEmpty()) redirect_uri = GetRequest("redirect_url");
if (redirect_uri.IsNullOrEmpty()) throw new ArgumentNullException(nameof(redirect_uri));
if (response_type.IsNullOrEmpty()) response_type = "code";