Skip to content

Commit

Permalink
perform CMS HTTP header checks only if CMSHeaders are eneabled
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Jan 6, 2022
1 parent 07678bb commit 081b8d9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,17 +554,17 @@ func oauthRequestHandler(w http.ResponseWriter, r *http.Request) {
if Config.Verbose > 0 {
printHTTPRequest(r, "cms headers")
}
}

// check if cms credentials are in place
cmsLoginName := r.Header.Get("Cms-Authn-Login")
cmsAuthCert := r.Header.Get("Cms-Auth-Cert")
if cmsAuthCert == "" || cmsLoginName == "" {
log.Printf("request headers %+v\n", r.Header)
msg := fmt.Sprintf("not authorized access")
status = http.StatusUnauthorized
http.Error(w, msg, status)
return
// check if cms credentials are in place
cmsLoginName := r.Header.Get("Cms-Authn-Login")
cmsAuthCert := r.Header.Get("Cms-Auth-Cert")
if cmsAuthCert == "" || cmsLoginName == "" {
log.Printf("request headers %+v\n", r.Header)
msg := fmt.Sprintf("not authorized access")
status = http.StatusUnauthorized
http.Error(w, msg, status)
return
}
}

// for /auth path we simply return status ok
Expand Down

0 comments on commit 081b8d9

Please sign in to comment.