passport-oauth2 icon indicating copy to clipboard operation
passport-oauth2 copied to clipboard

Don't swallow error if error and error_description are provided

Open mvakula opened this issue 3 years ago • 0 comments

The OAuth2 spec states the authorization server should respond with a HTTP 400 if there is an error in the access token response. The details of the error are conveyed in the error, error_description, and error_uri fields in the response.

GitHub OAuth does not follow this spec exactly and can return an error response (examples) with HTTP code 200. In this case, the error from GitHub is swallowed and instead we return a generic error. This makes it difficult to debug exactly what went wrong when GitHub returns an access token response error.

mvakula avatar Nov 16 '22 12:11 mvakula