Merge 0201bdd0bd into e27921ee80
This commit is contained in:
commit
5e5cadba15
|
|
@ -633,6 +633,10 @@ func (p *OAuthProxy) isTrustedIP(req *http.Request) bool {
|
|||
// SignInPage writes the sign in template to the response
|
||||
func (p *OAuthProxy) SignInPage(rw http.ResponseWriter, req *http.Request, code int) {
|
||||
prepareNoCache(rw)
|
||||
rw.Header().Set("WWW-Authenticate", "Bearer")
|
||||
if p.basicAuthValidator != nil {
|
||||
rw.Header().Add("WWW-Authenticate", "Basic")
|
||||
}
|
||||
rw.WriteHeader(code)
|
||||
|
||||
redirectURL, err := p.appDirector.GetRedirect(req)
|
||||
|
|
@ -1038,7 +1042,7 @@ func (p *OAuthProxy) Proxy(rw http.ResponseWriter, req *http.Request) {
|
|||
// the user did not explicitly start the login flow
|
||||
p.doOAuthStart(rw, req, nil)
|
||||
} else {
|
||||
p.SignInPage(rw, req, http.StatusForbidden)
|
||||
p.SignInPage(rw, req, http.StatusUnauthorized)
|
||||
}
|
||||
|
||||
case ErrAccessDenied:
|
||||
|
|
|
|||
Loading…
Reference in New Issue