Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom headers in request #59

Closed
fabsrc opened this issue Sep 27, 2018 · 0 comments
Closed

Allow custom headers in request #59

fabsrc opened this issue Sep 27, 2018 · 0 comments

Comments

@fabsrc
Copy link
Contributor

fabsrc commented Sep 27, 2018

Currently it is not possible to set custom headers when requesting the keys.

In our case this lead to the following problem: the "request" module sets the Accept header to application/json when json: true is used and no Accept header is set explicitly. See:

request({ json: true, uri: this.options.jwksUri, strictSSL: this.options.strictSsl }, (err, res) => {

https://github.com/request/request/blob/a92e138d897d78ce19dd70bd1ad271c7f9c6a23d/request.js#L1279-L1281

However if the server that stores the JWKS is configured to return a application/jwk-set+json content-type, a request with Accept: application/json is declined with a 406 error. To fix this we need to set the Accept header to either application/jwk-set+json or *.

It would be great if custom headers could be configured in the options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant