fix bug
This commit is contained in:
parent
77c6bcacca
commit
bd78f564b9
2 changed files with 36 additions and 54 deletions
|
@ -388,24 +388,6 @@ func extractIDTokenClaims(
|
||||||
return &finalClaims, nil
|
return &finalClaims, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// {
|
|
||||||
// var claims IDTokenClaims
|
|
||||||
// if err := idToken.Claims(&claims); err != nil {
|
|
||||||
// util.LogErr(err, "Failed to decode id token claims")
|
|
||||||
|
|
||||||
// writer.Header().Set("Content-Type", "text/plain; charset=utf-8")
|
|
||||||
// writer.WriteHeader(http.StatusBadRequest)
|
|
||||||
// _, werr := writer.Write([]byte("Failed to decode id token claims"))
|
|
||||||
// if werr != nil {
|
|
||||||
// util.LogErr(err, "Failed to write response")
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return nil, err
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return &claims, nil
|
|
||||||
// }
|
|
||||||
|
|
||||||
// validateOIDCAllowedDomains checks that if AllowedDomains is provided,
|
// validateOIDCAllowedDomains checks that if AllowedDomains is provided,
|
||||||
// that the authenticated principal ends with @<alloweddomain>.
|
// that the authenticated principal ends with @<alloweddomain>.
|
||||||
func validateOIDCAllowedDomains(
|
func validateOIDCAllowedDomains(
|
||||||
|
|
|
@ -254,9 +254,9 @@ func LoadConfig(path string, isFile bool) error {
|
||||||
viper.SetDefault("oidc.claims_map.email", "email")
|
viper.SetDefault("oidc.claims_map.email", "email")
|
||||||
viper.SetDefault("oidc.claims_map.groups", "groups")
|
viper.SetDefault("oidc.claims_map.groups", "groups")
|
||||||
// misc
|
// misc
|
||||||
viper.SetDefault("oidc.strip_email_domain", false)
|
viper.SetDefault("oidc.misc.strip_email_domain", false)
|
||||||
viper.SetDefault("oidc.flatten_groups", false)
|
viper.SetDefault("oidc.misc.flatten_groups", false)
|
||||||
viper.SetDefault("oidc.flatten_splitter", "/")
|
viper.SetDefault("oidc.misc.flatten_splitter", "/")
|
||||||
|
|
||||||
viper.SetDefault("logtail.enabled", false)
|
viper.SetDefault("logtail.enabled", false)
|
||||||
viper.SetDefault("randomize_client_port", false)
|
viper.SetDefault("randomize_client_port", false)
|
||||||
|
@ -695,9 +695,9 @@ func GetOIDCConfig() (OIDCConfig, error) {
|
||||||
}
|
}
|
||||||
// get misc config
|
// get misc config
|
||||||
oidcMiscConfig := OIDCMiscConfig{
|
oidcMiscConfig := OIDCMiscConfig{
|
||||||
StripEmaildomain: viper.GetBool("oidc.strip_email_domain"),
|
StripEmaildomain: viper.GetBool("oidc.misc.strip_email_domain"),
|
||||||
FlattenGroups: viper.GetBool("oidc.flatten_groups"),
|
FlattenGroups: viper.GetBool("oidc.misc.flatten_groups"),
|
||||||
FlattenSplter: viper.GetString("oidc.flatten_splitter"),
|
FlattenSplter: viper.GetString("oidc.misc.flatten_splitter"),
|
||||||
}
|
}
|
||||||
// get client secret
|
// get client secret
|
||||||
oidcClientSecret := viper.GetString("oidc.client_secret")
|
oidcClientSecret := viper.GetString("oidc.client_secret")
|
||||||
|
|
Loading…
Reference in a new issue