From 2612894557ad0f2c69039b35273b197b94773ad5 Mon Sep 17 00:00:00 2001
From: wxg0103 <727495428@qq.com>
Date: Mon, 31 Mar 2025 18:47:08 +0800
Subject: [PATCH] refactor: oidc add state
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
--bug=1054135 --user=王孝刚 【认证】maxkb在调用okta的时候少个state参数,可以加上state参数 https://www.tapd.cn/57709429/s/1678654
---
ui/src/views/authentication/component/OIDC.vue | 4 ++++
ui/src/views/login/index.vue | 3 +++
2 files changed, 7 insertions(+)
diff --git a/ui/src/views/authentication/component/OIDC.vue b/ui/src/views/authentication/component/OIDC.vue
index a8ed1d98e..2666bc647 100644
--- a/ui/src/views/authentication/component/OIDC.vue
+++ b/ui/src/views/authentication/component/OIDC.vue
@@ -39,6 +39,9 @@
+
+
+
({
tokenEndpoint: '',
userInfoEndpoint: '',
scope: '',
+ state: '',
clientId: '',
clientSecret: '',
redirectUrl: ''
diff --git a/ui/src/views/login/index.vue b/ui/src/views/login/index.vue
index fff8a874c..4cacd7ee5 100644
--- a/ui/src/views/login/index.vue
+++ b/ui/src/views/login/index.vue
@@ -184,6 +184,9 @@ function redirectAuth(authType: string) {
if (authType === 'OIDC') {
const scope = config.scope || 'openid+profile+email'
url = `${config.authEndpoint}?client_id=${config.clientId}&redirect_uri=${redirectUrl}&response_type=code&scope=${scope}`
+ if (config.state) {
+ url += `&state=${config.state}`
+ }
}
if (authType === 'OAuth2') {
url =