panva / openid-client

OAuth 2 / OpenID Connect Client API for JavaScript Runtimes
MIT License
1.83k stars 392 forks source link

Cannot customizing individual HTTP requests #257

Closed buithienquyet closed 4 years ago

buithienquyet commented 4 years ago

Hello! I tried using custom HTTP request, but not working. I assigned a funtion: ảnh and console logged new options: ảnh but it still throws error with default options timeout 2500ms when calling client.callback() after that ảnh I don't know what wrong? Thank you very much!

panva commented 4 years ago

It’s probably not a client instance timeout, an Issuer instance timeout can happen too when fetching its jwks_uri for the first time.

buithienquyet commented 4 years ago

It’s probably not a client instance timeout, an Issuer instance timeout can happen too when fetching its jwks_uri for the first time.

Thanks for your response, but I initialized Issuer by passing metadata, I tried setting global options and it worked but i want to set options locally for each client. Thanks!

panva commented 4 years ago

client !== issuer

Read the text before the code snippet

https://github.com/panva/node-openid-client/blob/master/docs/README.md#customizing-individual-http-requests

buithienquyet commented 4 years ago

client !== issuer

Read the text before the code snippet

https://github.com/panva/node-openid-client/blob/master/docs/README.md#customizing-individual-http-requests

I have fixed this, I must set options for both client and issuer. Thank you very much!