This commit is contained in:
Andrew Azores 2025-12-12 17:42:31 -05:00 committed by GitHub
commit 5e5cadba15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -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: