Skip to content

Commit 2612894

Browse files
committed
refactor: oidc add state
--bug=1054135 --user=王孝刚 【认证】maxkb在调用okta的时候少个state参数,可以加上state参数 https://www.tapd.cn/57709429/s/1678654
1 parent 7afc1da commit 2612894

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

ui/src/views/authentication/component/OIDC.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
<el-form-item label="Scope" prop="config_data.scope">
4040
<el-input v-model="form.config_data.scope" placeholder="openid+profile+email " />
4141
</el-form-item>
42+
<el-form-item label="State" prop="config_data.state">
43+
<el-input v-model="form.config_data.state" placeholder="" />
44+
</el-form-item>
4245
<el-form-item
4346
:label="$t('views.system.authentication.oidc.clientId')"
4447
prop="config_data.clientId"
@@ -98,6 +101,7 @@ const form = ref<any>({
98101
tokenEndpoint: '',
99102
userInfoEndpoint: '',
100103
scope: '',
104+
state: '',
101105
clientId: '',
102106
clientSecret: '',
103107
redirectUrl: ''

ui/src/views/login/index.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ function redirectAuth(authType: string) {
184184
if (authType === 'OIDC') {
185185
const scope = config.scope || 'openid+profile+email'
186186
url = `${config.authEndpoint}?client_id=${config.clientId}&redirect_uri=${redirectUrl}&response_type=code&scope=${scope}`
187+
if (config.state) {
188+
url += `&state=${config.state}`
189+
}
187190
}
188191
if (authType === 'OAuth2') {
189192
url =

0 commit comments

Comments
 (0)