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 configuration of oidc client timeout #249

Closed
jmacvey opened this issue Jun 24, 2021 · 1 comment · Fixed by #251
Closed

allow configuration of oidc client timeout #249

jmacvey opened this issue Jun 24, 2021 · 1 comment · Fixed by #251
Labels
enhancement New feature or request

Comments

@jmacvey
Copy link
Contributor

jmacvey commented Jun 24, 2021

Describe the problem you'd like to have solved

We have an internal oidc issuer whose response time is less than performant. To accommodate them, I'd like to be able to configure the http timeout. If I leverage the openid-client package directly without using the sdk, I can do the following:

const { custom } = require('openid-client')

custom.setHttpOptionsDefaults({
  timeout: 10000, // set custom timeout
})

This doesn't work with the SDK, however, because the timeout is always overridden to 5000ms in client.js.

Describe the ideal solution

Depends. If you want to control the interface, you could expose a timeout option on the ConfigParams object. Otherwise the quick solution would be to just to check if the timeout if null / undefined just before you set it in client.js, and let consumers override default http options using the underlying open-id client package as shown above.

Alternatives and current work-arounds

Haven't considered alternatives. If the above sounds like a good idea let me know and I'll submit a PR.

Thanks!

@adamjmcgrath
Copy link
Contributor

If the above sounds like a good idea let me know and I'll submit a PR.

Yep - good idea, thanks @jmacvey

If you raise a PR can you call the config param httpTimeout and set it in ms

@adamjmcgrath adamjmcgrath added the enhancement New feature or request label Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants