proxy: ask for pb_proxy scope, set authorization header if enabled

This commit is contained in:
Jens Langhammer
2020-09-30 11:49:06 +02:00
parent 59dbc15be7
commit 74f8b68af8
6 changed files with 101 additions and 74 deletions

View File

@ -51,6 +51,7 @@ func getCommonOptions() *options.Options {
commonOpts.Logging.SilencePing = true
commonOpts.SetXAuthRequest = true
commonOpts.SetAuthorization = false
commonOpts.Scope = "openid email profile pb_proxy"
return commonOpts
}

View File

@ -125,6 +125,12 @@ func (pb *providerBundle) Build(provider *models.ProxyOutpostConfig) {
os.Exit(1)
}
if *&provider.BasicAuthEnabled {
oauthproxy.SetBasicAuth = true
oauthproxy.BasicAuthUserAttribute = provider.BasicAuthUserAttribute
oauthproxy.BasicAuthPasswordAttribute = provider.BasicAuthPasswordAttribute
}
pb.proxy = oauthproxy
pb.Handler = chain.Then(oauthproxy)
}