@@ -29,16 +29,17 @@ type OauthProxy struct {
2929 CookieExpire time.Duration
3030 Validator func(string) bool
3131
32− redirectUrl *url.URL // the url to receive requests at
33− oauthRedemptionUrl *url.URL // endpoint to redeem the code
34− oauthLoginUrl *url.URL // to redirect the user to
35− oauthScope string
36− clientID string
37− clientSecret string
38− SignInMessage string
39− HtpasswdFile *HtpasswdFile
40− serveMux *http.ServeMux
41− PassBasicAuth bool
32+ redirectUrl *url.URL // the url to receive requests at
33+ oauthRedemptionUrl *url.URL // endpoint to redeem the code
34+ oauthLoginUrl *url.URL // to redirect the user to
35+ oauthScope string
36+ clientID string
37+ clientSecret string
38+ SignInMessage string
39+ HtpasswdFile *HtpasswdFile
40+ DisplayHtpasswdForm bool
41+ serveMux *http.ServeMux
42+ PassBasicAuth bool
4243}
4344
4445func NewOauthProxy(opts *Options, validator func(string) bool) *OauthProxy {
@@ -114,6 +115,10 @@ func apiRequest(req *http.Request) (*simplejson.Json, error) {
114115 return data, nil
115116}
116117
118+func (p *OauthProxy) displayCustomLoginForm() bool {
119+ return p.HtpasswdFile != nil && p.DisplayHtpasswdForm
120+}
121+
117122func (p *OauthProxy) redeemCode(code string) (string, string, error) {
118123 if code == "" {
119124 return "", "", errors.New("missing code")
@@ -232,12 +237,12 @@ func (p *OauthProxy) SignInPage(rw http.ResponseWriter, req *http.Request, code
232237
233238 t := struct {
234239 SignInMessage string
235− Htpasswd bool
240+ CustomLogin bool
236241 Redirect string
237242 Version string
238243 }{
239244 SignInMessage: p.SignInMessage,
240− Htpasswd: p.HtpasswdFile != nil,
245+ CustomLogin: p.displayCustomLoginForm(),
241246 Redirect: req.URL.RequestURI(),
242247 Version: VERSION,
243248 }