fix: Change the AppId and AppSecret on the Web UI to the standard usage: ClientId, ClientSecret.
This commit is contained in:
parent
8a283fff3b
commit
f8144fe534
@ -24,7 +24,7 @@ const config = {
|
|||||||
wechat_login: false,
|
wechat_login: false,
|
||||||
wechat_qrcode: '',
|
wechat_qrcode: '',
|
||||||
oidc: false,
|
oidc: false,
|
||||||
oidc_app_id: '',
|
oidc_client_id: '',
|
||||||
oidc_authorization_endpoint: '',
|
oidc_authorization_endpoint: '',
|
||||||
oidc_token_endpoint: '',
|
oidc_token_endpoint: '',
|
||||||
oidc_userinfo_endpoint: '',
|
oidc_userinfo_endpoint: '',
|
||||||
|
@ -152,7 +152,7 @@ const LoginForm = ({ ...others }) => {
|
|||||||
<Button
|
<Button
|
||||||
disableElevation
|
disableElevation
|
||||||
fullWidth
|
fullWidth
|
||||||
onClick={() => onOidcClicked(siteInfo.oidc_authorization_endpoint,siteInfo.oidc_app_id)}
|
onClick={() => onOidcClicked(siteInfo.oidc_authorization_endpoint,siteInfo.oidc_client_id)}
|
||||||
size="large"
|
size="large"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
sx={{
|
sx={{
|
||||||
|
@ -231,7 +231,7 @@ export default function Profile() {
|
|||||||
)}
|
)}
|
||||||
{status.oidc && !inputs.oidc_id && (
|
{status.oidc && !inputs.oidc_id && (
|
||||||
<Grid xs={12} md={4}>
|
<Grid xs={12} md={4}>
|
||||||
<Button variant="contained" onClick={() => onOidcClicked(status.oidc_authorization_endpoint,status.oidc_app_id,true)}>
|
<Button variant="contained" onClick={() => onOidcClicked(status.oidc_authorization_endpoint,status.oidc_client_id,true)}>
|
||||||
绑定 OIDC 账号
|
绑定 OIDC 账号
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -34,8 +34,8 @@ const SystemSetting = () => {
|
|||||||
LarkClientId: '',
|
LarkClientId: '',
|
||||||
LarkClientSecret: '',
|
LarkClientSecret: '',
|
||||||
OidcEnabled: '',
|
OidcEnabled: '',
|
||||||
OidcAppId: '',
|
OidcClientId: '',
|
||||||
OidcAppSecret: '',
|
OidcClientSecret: '',
|
||||||
OidcAuthorizationEndpoint: '',
|
OidcAuthorizationEndpoint: '',
|
||||||
OidcTokenEndpoint: '',
|
OidcTokenEndpoint: '',
|
||||||
OidcUserinfoEndpoint: '',
|
OidcUserinfoEndpoint: '',
|
||||||
@ -240,18 +240,18 @@ const SystemSetting = () => {
|
|||||||
|
|
||||||
const submitOidc = async () => {
|
const submitOidc = async () => {
|
||||||
const OidcConfig = {
|
const OidcConfig = {
|
||||||
OidcAppId: inputs.OidcAppId,
|
OidcClientId: inputs.OidcClientId,
|
||||||
OidcAppSecret: inputs.OidcAppSecret,
|
OidcClientSecret: inputs.OidcClientSecret,
|
||||||
OidcAuthorizationEndpoint: inputs.OidcAuthorizationEndpoint,
|
OidcAuthorizationEndpoint: inputs.OidcAuthorizationEndpoint,
|
||||||
OidcTokenEndpoint: inputs.OidcTokenEndpoint,
|
OidcTokenEndpoint: inputs.OidcTokenEndpoint,
|
||||||
OidcUserinfoEndpoint: inputs.OidcUserinfoEndpoint
|
OidcUserinfoEndpoint: inputs.OidcUserinfoEndpoint
|
||||||
};
|
};
|
||||||
console.log(OidcConfig);
|
console.log(OidcConfig);
|
||||||
if (originInputs['OidcAppId'] !== inputs.OidcAppId) {
|
if (originInputs['OidcClientId'] !== inputs.OidcClientId) {
|
||||||
await updateOption('OidcAppId', inputs.OidcAppId);
|
await updateOption('OidcClientId', inputs.OidcClientId);
|
||||||
}
|
}
|
||||||
if (originInputs['OidcAppSecret'] !== inputs.OidcAppSecret && inputs.OidcAppSecret !== '') {
|
if (originInputs['OidcClientSecret'] !== inputs.OidcClientSecret && inputs.OidcClientSecret !== '') {
|
||||||
await updateOption('OidcAppSecret', inputs.OidcAppSecret);
|
await updateOption('OidcClientSecret', inputs.OidcClientSecret);
|
||||||
}
|
}
|
||||||
if (originInputs['OidcAuthorizationEndpoint'] !== inputs.OidcAuthorizationEndpoint) {
|
if (originInputs['OidcAuthorizationEndpoint'] !== inputs.OidcAuthorizationEndpoint) {
|
||||||
await updateOption('OidcAuthorizationEndpoint', inputs.OidcAuthorizationEndpoint);
|
await updateOption('OidcAuthorizationEndpoint', inputs.OidcAuthorizationEndpoint);
|
||||||
@ -332,7 +332,7 @@ const SystemSetting = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid xs={12} md={3}>
|
<Grid xs={12} md={3}>
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
label="允许通过 Oidc 登录 & 注册"
|
label="允许通过 OIDC 登录 & 注册"
|
||||||
control={<Checkbox checked={inputs.OidcEnabled === 'true'} onChange={handleInputChange} name="OidcEnabled" />}
|
control={<Checkbox checked={inputs.OidcEnabled === 'true'} onChange={handleInputChange} name="OidcEnabled" />}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
@ -679,27 +679,27 @@ const SystemSetting = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid xs={ 12 } md={ 6 }>
|
<Grid xs={ 12 } md={ 6 }>
|
||||||
<FormControl fullWidth>
|
<FormControl fullWidth>
|
||||||
<InputLabel htmlFor="OidcAppId">App ID</InputLabel>
|
<InputLabel htmlFor="OidcClientId">Client ID</InputLabel>
|
||||||
<OutlinedInput
|
<OutlinedInput
|
||||||
id="OidcAppId"
|
id="OidcClientId"
|
||||||
name="OidcAppId"
|
name="OidcClientId"
|
||||||
value={ inputs.OidcAppId || '' }
|
value={ inputs.OidcClientId || '' }
|
||||||
onChange={ handleInputChange }
|
onChange={ handleInputChange }
|
||||||
label="App ID"
|
label="Client ID"
|
||||||
placeholder="输入 OAuth 2.0 的 App ID"
|
placeholder="输入 OIDC 的 Client ID"
|
||||||
disabled={ loading }
|
disabled={ loading }
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid xs={ 12 } md={ 6 }>
|
<Grid xs={ 12 } md={ 6 }>
|
||||||
<FormControl fullWidth>
|
<FormControl fullWidth>
|
||||||
<InputLabel htmlFor="OidcAppSecret">App Secret</InputLabel>
|
<InputLabel htmlFor="OidcClientSecret">Client Secret</InputLabel>
|
||||||
<OutlinedInput
|
<OutlinedInput
|
||||||
id="OidcAppSecret"
|
id="OidcClientSecret"
|
||||||
name="OidcAppSecret"
|
name="OidcClientSecret"
|
||||||
value={ inputs.OidcAppSecret || '' }
|
value={ inputs.OidcClientSecret || '' }
|
||||||
onChange={ handleInputChange }
|
onChange={ handleInputChange }
|
||||||
label="App Secret"
|
label="Client Secret"
|
||||||
placeholder="敏感信息不会发送到前端显示"
|
placeholder="敏感信息不会发送到前端显示"
|
||||||
disabled={ loading }
|
disabled={ loading }
|
||||||
/>
|
/>
|
||||||
@ -707,49 +707,49 @@ const SystemSetting = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid xs={ 12 } md={ 6 }>
|
<Grid xs={ 12 } md={ 6 }>
|
||||||
<FormControl fullWidth>
|
<FormControl fullWidth>
|
||||||
<InputLabel htmlFor="OidcAuthorizationEndpoint">授权地址</InputLabel>
|
<InputLabel htmlFor="OidcAuthorizationEndpoint">Authorization Endpoint</InputLabel>
|
||||||
<OutlinedInput
|
<OutlinedInput
|
||||||
id="OidcAuthorizationEndpoint"
|
id="OidcAuthorizationEndpoint"
|
||||||
name="OidcAuthorizationEndpoint"
|
name="OidcAuthorizationEndpoint"
|
||||||
value={ inputs.OidcAuthorizationEndpoint || '' }
|
value={ inputs.OidcAuthorizationEndpoint || '' }
|
||||||
onChange={ handleInputChange }
|
onChange={ handleInputChange }
|
||||||
label="授权地址"
|
label="Authorization Endpoint"
|
||||||
placeholder="输入 OAuth 2.0 的 授权地址"
|
placeholder="输入 OIDC 的 Authorization Endpoint"
|
||||||
disabled={ loading }
|
disabled={ loading }
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid xs={ 12 } md={ 6 }>
|
<Grid xs={ 12 } md={ 6 }>
|
||||||
<FormControl fullWidth>
|
<FormControl fullWidth>
|
||||||
<InputLabel htmlFor="OidcTokenEndpoint">认证地址</InputLabel>
|
<InputLabel htmlFor="OidcTokenEndpoint">Token Endpoint</InputLabel>
|
||||||
<OutlinedInput
|
<OutlinedInput
|
||||||
id="OidcTokenEndpoint"
|
id="OidcTokenEndpoint"
|
||||||
name="OidcTokenEndpoint"
|
name="OidcTokenEndpoint"
|
||||||
value={ inputs.OidcTokenEndpoint || '' }
|
value={ inputs.OidcTokenEndpoint || '' }
|
||||||
onChange={ handleInputChange }
|
onChange={ handleInputChange }
|
||||||
label="认证地址"
|
label="Token Endpoint"
|
||||||
placeholder="输入 OAuth 2.0 的 认证地址"
|
placeholder="输入 OIDC 的 Token Endpoint"
|
||||||
disabled={ loading }
|
disabled={ loading }
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid xs={ 12 } md={ 6 }>
|
<Grid xs={ 12 } md={ 6 }>
|
||||||
<FormControl fullWidth>
|
<FormControl fullWidth>
|
||||||
<InputLabel htmlFor="OidcUserinfoEndpoint">用户地址</InputLabel>
|
<InputLabel htmlFor="OidcUserinfoEndpoint">Userinfo Endpoint</InputLabel>
|
||||||
<OutlinedInput
|
<OutlinedInput
|
||||||
id="OidcUserinfoEndpoint"
|
id="OidcUserinfoEndpoint"
|
||||||
name="OidcUserinfoEndpoint"
|
name="OidcUserinfoEndpoint"
|
||||||
value={ inputs.OidcUserinfoEndpoint || '' }
|
value={ inputs.OidcUserinfoEndpoint || '' }
|
||||||
onChange={ handleInputChange }
|
onChange={ handleInputChange }
|
||||||
label="认证地址"
|
label="认证地址"
|
||||||
placeholder="输入 OAuth 2.0 的 认证地址"
|
placeholder="输入 OIDC 的 Userinfo Endpoint"
|
||||||
disabled={ loading }
|
disabled={ loading }
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid xs={ 12 }>
|
<Grid xs={ 12 }>
|
||||||
<Button variant="contained" onClick={ submitOidc }>
|
<Button variant="contained" onClick={ submitOidc }>
|
||||||
保存第三方 OAuth 2.0 设置
|
保存 OIDC 设置
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
Loading…
Reference in New Issue
Block a user