refactor: oidc add state
--bug=1054135 --user=王孝刚 【认证】maxkb在调用okta的时候少个state参数,可以加上state参数 https://www.tapd.cn/57709429/s/1678654v3.2
parent
7afc1da0af
commit
2612894557
|
|
@ -39,6 +39,9 @@
|
||||||
<el-form-item label="Scope" prop="config_data.scope">
|
<el-form-item label="Scope" prop="config_data.scope">
|
||||||
<el-input v-model="form.config_data.scope" placeholder="openid+profile+email " />
|
<el-input v-model="form.config_data.scope" placeholder="openid+profile+email " />
|
||||||
</el-form-item>
|
</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
|
<el-form-item
|
||||||
:label="$t('views.system.authentication.oidc.clientId')"
|
:label="$t('views.system.authentication.oidc.clientId')"
|
||||||
prop="config_data.clientId"
|
prop="config_data.clientId"
|
||||||
|
|
@ -98,6 +101,7 @@ const form = ref<any>({
|
||||||
tokenEndpoint: '',
|
tokenEndpoint: '',
|
||||||
userInfoEndpoint: '',
|
userInfoEndpoint: '',
|
||||||
scope: '',
|
scope: '',
|
||||||
|
state: '',
|
||||||
clientId: '',
|
clientId: '',
|
||||||
clientSecret: '',
|
clientSecret: '',
|
||||||
redirectUrl: ''
|
redirectUrl: ''
|
||||||
|
|
|
||||||
|
|
@ -184,6 +184,9 @@ function redirectAuth(authType: string) {
|
||||||
if (authType === 'OIDC') {
|
if (authType === 'OIDC') {
|
||||||
const scope = config.scope || 'openid+profile+email'
|
const scope = config.scope || 'openid+profile+email'
|
||||||
url = `${config.authEndpoint}?client_id=${config.clientId}&redirect_uri=${redirectUrl}&response_type=code&scope=${scope}`
|
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') {
|
if (authType === 'OAuth2') {
|
||||||
url =
|
url =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue