mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-28 23:32:48 +00:00
refactor: oidc add scope
This commit is contained in:
parent
7f597b6409
commit
237dd8c209
|
|
@ -40,6 +40,7 @@ export default {
|
|||
userInfoEndpointPlaceholder: 'Please enter user information endpoint',
|
||||
clientId: 'Client ID',
|
||||
clientIdPlaceholder: 'Please enter client ID',
|
||||
scopePlaceholder: 'Please enter scope',
|
||||
clientSecret: 'Client Secret',
|
||||
clientSecretPlaceholder: 'Please enter client secret',
|
||||
logoutEndpoint: 'Logout Endpoint',
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ export default {
|
|||
tokenEndpointPlaceholder: '请输入 Token 端地址',
|
||||
userInfoEndpoint: '用户信息端地址',
|
||||
userInfoEndpointPlaceholder: '请输入用户信息端地址',
|
||||
scopePlaceholder: '请输入连接范围',
|
||||
clientId: '客户端 ID',
|
||||
clientIdPlaceholder: '请输入客户端 ID',
|
||||
clientSecret: '客户端密钥',
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ export default {
|
|||
userInfoEndpoint: '使用者資訊端位址',
|
||||
userInfoEndpointPlaceholder: '請輸入使用者資訊端位址',
|
||||
clientId: '用戶端 ID',
|
||||
scopePlaceholder: '請輸入連線範圍',
|
||||
clientIdPlaceholder: '請輸入用戶端 ID',
|
||||
clientSecret: '用戶端密鑰',
|
||||
clientSecretPlaceholder: '請輸入用戶端密鑰',
|
||||
|
|
|
|||
|
|
@ -36,6 +36,9 @@
|
|||
:placeholder="$t('views.system.authentication.oidc.userInfoEndpointPlaceholder')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<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="$t('views.system.authentication.oidc.clientId')"
|
||||
prop="config_data.clientId"
|
||||
|
|
@ -94,6 +97,7 @@ const form = ref<any>({
|
|||
authEndpoint: '',
|
||||
tokenEndpoint: '',
|
||||
userInfoEndpoint: '',
|
||||
scope: '',
|
||||
clientId: '',
|
||||
clientSecret: '',
|
||||
redirectUrl: ''
|
||||
|
|
@ -127,6 +131,13 @@ const rules = reactive<FormRules<any>>({
|
|||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
'config_data.scope': [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.system.authentication.oidc.scopePlaceholder'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
'config_data.clientId': [
|
||||
{
|
||||
required: true,
|
||||
|
|
|
|||
|
|
@ -177,7 +177,8 @@ function redirectAuth(authType: string) {
|
|||
}
|
||||
}
|
||||
if (authType === 'OIDC') {
|
||||
url = `${config.authEndpoint}?client_id=${config.clientId}&redirect_uri=${redirectUrl}&response_type=code&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}`
|
||||
}
|
||||
if (authType === 'OAuth2') {
|
||||
url =
|
||||
|
|
|
|||
Loading…
Reference in New Issue