IdentityModel / oidc-client-js

OpenID Connect (OIDC) and OAuth2 protocol support for browser-based JavaScript applications
Apache License 2.0
2.43k stars 840 forks source link

Include payload properties on event errors #1175

Open anied opened 4 years ago

anied commented 4 years ago

Sometimes the error property returned on failures from our IDP endpoint is rather generic, and other fields contain important additional information. It would be useful if those fields could be duplicated onto the Error being passed into the Promise reject. I made an (untested) example of how this could be done on a fork in the section of JsonService.js that handles a 400 response. I'd be happy to make these changes myself and open a PR with a little direction on how to contribute and some feedback how to make this feature viable.