Skip to content

Commit

Permalink
fix: do not use error_hint anymore (#2450)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitar committed Apr 9, 2021
1 parent aa2919d commit ff90c47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oauth2/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,14 @@ func (h *Handler) UserinfoHandler(w http.ResponseWriter, r *http.Request) {
if err != nil {
rfcerr := fosite.ErrorToRFC6749Error(err)
if rfcerr.StatusCode() == http.StatusUnauthorized {
w.Header().Set("WWW-Authenticate", fmt.Sprintf("error=%s,error_description=%s,error_hint=%s", rfcerr.ErrorField, rfcerr.DescriptionField, rfcerr.HintField))
w.Header().Set("WWW-Authenticate", fmt.Sprintf("error=%s,error_description=%s", rfcerr.ErrorField, rfcerr.GetDescription()))
}
h.r.Writer().WriteError(w, r, err)
return
}

if tokenType != fosite.AccessToken {
errorDescription := "Only access tokens are allowed in the authorization header"
errorDescription := "Only access tokens are allowed in the authorization header."
w.Header().Set("WWW-Authenticate", fmt.Sprintf("error_description=\"%s\"", errorDescription))
h.r.Writer().WriteErrorCode(w, r, http.StatusUnauthorized, errors.New(errorDescription))
return
Expand Down

0 comments on commit ff90c47

Please sign in to comment.