From a631c7f8f0e6d186794a4a710f31a13b75231fbd Mon Sep 17 00:00:00 2001
From: Tao Chen <42793494+IamTaoChen@users.noreply.github.com>
Date: Wed, 19 Feb 2025 09:56:22 +0800
Subject: [PATCH] feat: Feat/OIDC pcke (#14)
* add pkce for oidc
* fix
* test
* test
---
src/views/oauth/index.vue | 41 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 40 insertions(+), 1 deletion(-)
diff --git a/src/views/oauth/index.vue b/src/views/oauth/index.vue
index db53c5e..0cab38d 100644
--- a/src/views/oauth/index.vue
+++ b/src/views/oauth/index.vue
@@ -14,6 +14,8 @@
+
+
@@ -60,6 +62,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{
+ const allowedValues = ["S256", "Plain"];
+ if (!allowedValues.includes(value)) {
+ callback(new Error(T('InvalidParam', { param: 'pkce_method' })));
+ } else {
+ callback(); // 校验通过
+ }
+ },
+ trigger: 'change'
+ }
+ ]
}
const toEdit = (row) => {
formVisible.value = true
@@ -164,7 +200,8 @@
formData.redirect_url = row.redirect_url
formData.scopes = row.scopes
formData.auto_register = row.auto_register
-
+ formData.pkce_enable = row.pkce_enable
+ formData.pkce_method = row.pkce_method
}
const toAdd = () => {
formVisible.value = true
@@ -177,6 +214,8 @@
formData.redirect_url = ''
formData.scopes = ''
formData.auto_register = false
+ formData.pkce_enable = false
+ formData.pkce_method = 'S256'
}
const form = ref(null)
const submit = async () => {