1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-12-01 22:51:45 +02:00

add --set-xauthrequest flag for use in Nginx auth_request mode

This is enhancement of #173 to use "Auth Request" consistently in
the command-line option, configuration file and response headers.
It always sets the X-Auth-Request-User response header and if the
email is available, sets X-Auth-Request-Email as well.
This commit is contained in:
Lukasz Siudut
2016-10-20 17:49:59 +05:30
committed by Ashish Kulkarni
parent 93852a24cb
commit 829b442302
4 changed files with 41 additions and 0 deletions

View File

@@ -57,6 +57,7 @@ type Options struct {
SkipProviderButton bool `flag:"skip-provider-button" cfg:"skip_provider_button"`
PassUserHeaders bool `flag:"pass-user-headers" cfg:"pass_user_headers"`
SSLInsecureSkipVerify bool `flag:"ssl-insecure-skip-verify" cfg:"ssl_insecure_skip_verify"`
SetXAuthRequest bool `flag:"set-xauthrequest" cfg:"set_xauthrequest"`
// These options allow for other providers besides Google, with
// potential overrides.
@@ -97,6 +98,7 @@ func NewOptions() *Options {
CookieHttpOnly: true,
CookieExpire: time.Duration(168) * time.Hour,
CookieRefresh: time.Duration(0),
SetXAuthRequest: false,
PassBasicAuth: true,
PassUserHeaders: true,
PassAccessToken: false,