@@ -43,6 +43,7 @@ type OAuthProxy struct {
4343 DisplayHtpasswdForm bool
4444 serveMux http.Handler
4545 PassBasicAuth bool
46+ SkipProviderButton bool
4647 BasicAuthPassword string
4748 PassAccessToken bool
4849 CookieCipher *cookie.Cipher
@@ -159,17 +160,18 @@ func NewOAuthProxy(opts *Options, validator func(string) bool) *OAuthProxy {
159160 OAuthCallbackPath: fmt.Sprintf("%s/callback", opts.ProxyPrefix),
160161 AuthOnlyPath: fmt.Sprintf("%s/auth", opts.ProxyPrefix),
161162
162− ProxyPrefix: opts.ProxyPrefix,
163− provider: opts.provider,
164− serveMux: serveMux,
165− redirectURL: redirectURL,
166− skipAuthRegex: opts.SkipAuthRegex,
167− compiledRegex: opts.CompiledRegex,
168− PassBasicAuth: opts.PassBasicAuth,
169− BasicAuthPassword: opts.BasicAuthPassword,
170− PassAccessToken: opts.PassAccessToken,
171− CookieCipher: cipher,
172− templates: loadTemplates(opts.CustomTemplatesDir),
163+ ProxyPrefix: opts.ProxyPrefix,
164+ provider: opts.provider,
165+ serveMux: serveMux,
166+ redirectURL: redirectURL,
167+ skipAuthRegex: opts.SkipAuthRegex,
168+ compiledRegex: opts.CompiledRegex,
169+ PassBasicAuth: opts.PassBasicAuth,
170+ BasicAuthPassword: opts.BasicAuthPassword,
171+ PassAccessToken: opts.PassAccessToken,
172+ SkipProviderButton: opts.SkipProviderButton,
173+ CookieCipher: cipher,
174+ templates: loadTemplates(opts.CustomTemplatesDir),
173175 }
174176}
175177
@@ -484,7 +486,11 @@ func (p *OAuthProxy) Proxy(rw http.ResponseWriter, req *http.Request) {
484486 p.ErrorPage(rw, http.StatusInternalServerError,
485487 "Internal Error", "Internal Error")
486488 } else if status == http.StatusForbidden {
487− p.SignInPage(rw, req, http.StatusForbidden)
489+ if p.SkipProviderButton {
490+ p.OAuthStart(rw, req)
491+ } else {
492+ p.SignInPage(rw, req, http.StatusForbidden)
493+ }
488494 } else {
489495 p.serveMux.ServeHTTP(rw, req)
490496 }