feat: Standardize terminology, add well-known configuration
- Change the AppId and AppSecret on the Server End to the standard usage: ClientId, ClientSecret. - add Well-Known configuration to store in database, no actual use in server end but store and display in web ui only
This commit is contained in:
parent
e66b73faf5
commit
af8be721c5
@ -71,8 +71,9 @@ var GitHubClientSecret = ""
|
|||||||
var LarkClientId = ""
|
var LarkClientId = ""
|
||||||
var LarkClientSecret = ""
|
var LarkClientSecret = ""
|
||||||
|
|
||||||
var OidcAppId = ""
|
var OidcClientId = ""
|
||||||
var OidcAppSecret = ""
|
var OidcClientSecret = ""
|
||||||
|
var OidcWellKnown = ""
|
||||||
var OidcAuthorizationEndpoint = ""
|
var OidcAuthorizationEndpoint = ""
|
||||||
var OidcTokenEndpoint = ""
|
var OidcTokenEndpoint = ""
|
||||||
var OidcUserinfoEndpoint = ""
|
var OidcUserinfoEndpoint = ""
|
||||||
|
@ -38,8 +38,8 @@ func getOidcUserInfoByCode(code string) (*OidcUser, error) {
|
|||||||
return nil, errors.New("无效的参数")
|
return nil, errors.New("无效的参数")
|
||||||
}
|
}
|
||||||
values := map[string]string{
|
values := map[string]string{
|
||||||
"client_id": config.OidcAppId,
|
"client_id": config.OidcClientId,
|
||||||
"client_secret": config.OidcAppSecret,
|
"client_secret": config.OidcClientSecret,
|
||||||
"code": code,
|
"code": code,
|
||||||
"grant_type": "authorization_code",
|
"grant_type": "authorization_code",
|
||||||
"redirect_uri": fmt.Sprintf("%s/oauth/oidc", config.ServerAddress),
|
"redirect_uri": fmt.Sprintf("%s/oauth/oidc", config.ServerAddress),
|
||||||
|
@ -37,7 +37,8 @@ func GetStatus(c *gin.Context) {
|
|||||||
"quota_per_unit": config.QuotaPerUnit,
|
"quota_per_unit": config.QuotaPerUnit,
|
||||||
"display_in_currency": config.DisplayInCurrencyEnabled,
|
"display_in_currency": config.DisplayInCurrencyEnabled,
|
||||||
"oidc": config.OidcEnabled,
|
"oidc": config.OidcEnabled,
|
||||||
"oidc_app_id": config.OidcAppId,
|
"oidc_client_id": config.OidcClientId,
|
||||||
|
"oidc_well_known": config.OidcWellKnown,
|
||||||
"oidc_authorization_endpoint": config.OidcAuthorizationEndpoint,
|
"oidc_authorization_endpoint": config.OidcAuthorizationEndpoint,
|
||||||
"oidc_token_endpoint": config.OidcTokenEndpoint,
|
"oidc_token_endpoint": config.OidcTokenEndpoint,
|
||||||
"oidc_userinfo_endpoint": config.OidcUserinfoEndpoint,
|
"oidc_userinfo_endpoint": config.OidcUserinfoEndpoint,
|
||||||
|
@ -179,10 +179,12 @@ func updateOptionMap(key string, value string) (err error) {
|
|||||||
config.LarkClientId = value
|
config.LarkClientId = value
|
||||||
case "LarkClientSecret":
|
case "LarkClientSecret":
|
||||||
config.LarkClientSecret = value
|
config.LarkClientSecret = value
|
||||||
case "OidcAppId":
|
case "OidcClientId":
|
||||||
config.OidcAppId = value
|
config.OidcClientId = value
|
||||||
case "OidcAppSecret":
|
case "OidcClientSecret":
|
||||||
config.OidcAppSecret = value
|
config.OidcClientSecret = value
|
||||||
|
case "OidcWellKnown":
|
||||||
|
config.OidcWellKnown = value
|
||||||
case "OidcAuthorizationEndpoint":
|
case "OidcAuthorizationEndpoint":
|
||||||
config.OidcAuthorizationEndpoint = value
|
config.OidcAuthorizationEndpoint = value
|
||||||
case "OidcTokenEndpoint":
|
case "OidcTokenEndpoint":
|
||||||
|
Loading…
Reference in New Issue
Block a user