Commit eb517a37 by Tomas Dabasinskas

Update field name

parent e8823f71
package setting package setting
type OAuthInfo struct { type OAuthInfo struct {
ClientId, ClientSecret string ClientId, ClientSecret string
Scopes []string Scopes []string
AuthUrl, TokenUrl string AuthUrl, TokenUrl string
Enabled bool Enabled bool
EmailAttributeName string EmailAttributeName string
AllowedDomains []string AllowedDomains []string
HostedDomain string HostedDomain string
ApiUrl string ApiUrl string
AllowSignup bool AllowSignup bool
Name string Name string
TlsClientCert string TlsClientCert string
TlsClientKey string TlsClientKey string
TlsClientCa string TlsClientCa string
TlsSkipVerify bool TlsSkipVerify bool
BrokenAuthHeaderProvider bool SendClientCredentialsViaPost bool
} }
type OAuther struct { type OAuther struct {
......
...@@ -63,23 +63,23 @@ func NewOAuthService() { ...@@ -63,23 +63,23 @@ func NewOAuthService() {
for _, name := range allOauthes { for _, name := range allOauthes {
sec := setting.Raw.Section("auth." + name) sec := setting.Raw.Section("auth." + name)
info := &setting.OAuthInfo{ info := &setting.OAuthInfo{
ClientId: sec.Key("client_id").String(), ClientId: sec.Key("client_id").String(),
ClientSecret: sec.Key("client_secret").String(), ClientSecret: sec.Key("client_secret").String(),
Scopes: util.SplitString(sec.Key("scopes").String()), Scopes: util.SplitString(sec.Key("scopes").String()),
AuthUrl: sec.Key("auth_url").String(), AuthUrl: sec.Key("auth_url").String(),
TokenUrl: sec.Key("token_url").String(), TokenUrl: sec.Key("token_url").String(),
ApiUrl: sec.Key("api_url").String(), ApiUrl: sec.Key("api_url").String(),
Enabled: sec.Key("enabled").MustBool(), Enabled: sec.Key("enabled").MustBool(),
EmailAttributeName: sec.Key("email_attribute_name").String(), EmailAttributeName: sec.Key("email_attribute_name").String(),
AllowedDomains: util.SplitString(sec.Key("allowed_domains").String()), AllowedDomains: util.SplitString(sec.Key("allowed_domains").String()),
HostedDomain: sec.Key("hosted_domain").String(), HostedDomain: sec.Key("hosted_domain").String(),
AllowSignup: sec.Key("allow_sign_up").MustBool(), AllowSignup: sec.Key("allow_sign_up").MustBool(),
Name: sec.Key("name").MustString(name), Name: sec.Key("name").MustString(name),
TlsClientCert: sec.Key("tls_client_cert").String(), TlsClientCert: sec.Key("tls_client_cert").String(),
TlsClientKey: sec.Key("tls_client_key").String(), TlsClientKey: sec.Key("tls_client_key").String(),
TlsClientCa: sec.Key("tls_client_ca").String(), TlsClientCa: sec.Key("tls_client_ca").String(),
TlsSkipVerify: sec.Key("tls_skip_verify_insecure").MustBool(), TlsSkipVerify: sec.Key("tls_skip_verify_insecure").MustBool(),
BrokenAuthHeaderProvider: sec.Key("send_client_credentials_via_post").MustBool(), SendClientCredentialsViaPost: sec.Key("send_client_credentials_via_post").MustBool(),
} }
if !info.Enabled { if !info.Enabled {
...@@ -87,7 +87,7 @@ func NewOAuthService() { ...@@ -87,7 +87,7 @@ func NewOAuthService() {
} }
// handle the clients that do not properly support Basic auth headers and require passing client_id/client_secret via POST payload // handle the clients that do not properly support Basic auth headers and require passing client_id/client_secret via POST payload
if info.BrokenAuthHeaderProvider { if info.SendClientCredentialsViaPost {
oauth2.RegisterBrokenAuthHeaderProvider(info.TokenUrl) oauth2.RegisterBrokenAuthHeaderProvider(info.TokenUrl)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment