mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
refactor: oidc add state
--bug=1054135 --user=王孝刚 【认证】maxkb在调用okta的时候少个state参数,可以加上state参数 https://www.tapd.cn/57709429/s/1678654
This commit is contained in:
parent
7afc1da0af
commit
2612894557
|
|
@ -39,6 +39,9 @@
|
|||
<el-form-item label="Scope" prop="config_data.scope">
|
||||
<el-input v-model="form.config_data.scope" placeholder="openid+profile+email " />
|
||||
</el-form-item>
|
||||
<el-form-item label="State" prop="config_data.state">
|
||||
<el-input v-model="form.config_data.state" placeholder="" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('views.system.authentication.oidc.clientId')"
|
||||
prop="config_data.clientId"
|
||||
|
|
@ -98,6 +101,7 @@ const form = ref<any>({
|
|||
tokenEndpoint: '',
|
||||
userInfoEndpoint: '',
|
||||
scope: '',
|
||||
state: '',
|
||||
clientId: '',
|
||||
clientSecret: '',
|
||||
redirectUrl: ''
|
||||
|
|
|
|||
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Reference in New Issue