You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Client sometimes sends a request to https://localhost even though the passed in URL is different (e.g. https://redacted.domain.com/auth)
To Reproduce
I have absolutely no idea how to reproduce this problem, since it sometimes happens and sometimes it doesn't while the calls are exactly identical. But once it happens it always happens.
The normal authentication works perfectly fine. The error just occurs sometimes when calling
awaitthis.client.refresh(refreshToken);
Expected behaviour
The client should send a request to https://redacted.domain.com/auth/realms/RedactedRealm/protocol/openid-connect/token.
Actual behaviour
Sometimes the request is sent to https://localhost/[...], which fails because of course localhost is not SSL encrypted.
Environment:
openid-client version: v4.2.1
node version: v12.19.0
Additional context
Using the debugger I found the error might be happening with nodes ClientRequest within the got library. More specifically this line: https://github.com/sindresorhus/got/blob/fb5f791defdb6ddb3f01ac5142dde0538c84b864/source/core/index.ts#L2419
While url is still the correct value, and requestOptions also seem to be the correct value, the value of requestOrResponse has set the host attribute to localhost instead of the value of url. fn is in my case equal to https.request, since options.cache is undefined, options.request is undefined and isHttps is true.
This means the protocol (https) is correctly passed through, however the rest of the url is not.
the bug is happening on latest openid-client too.
i have searched the issues tracker on github for similar issues and couldn't find anything related.
The text was updated successfully, but these errors were encountered:
Describe the bug
Client sometimes sends a request to
https://localhost
even though the passed in URL is different (e.g.https://redacted.domain.com/auth
)To Reproduce
I have absolutely no idea how to reproduce this problem, since it sometimes happens and sometimes it doesn't while the calls are exactly identical. But once it happens it always happens.
Issuer Metadata
Client Metadata
Issuer and client are created the following way:
The normal authentication works perfectly fine. The error just occurs sometimes when calling
Expected behaviour
The client should send a request to
https://redacted.domain.com/auth/realms/RedactedRealm/protocol/openid-connect/token
.Actual behaviour
Sometimes the request is sent to
https://localhost/[...]
, which fails because of courselocalhost
is not SSL encrypted.Environment:
Additional context
Using the debugger I found the error might be happening with nodes
ClientRequest
within thegot
library. More specifically this line: https://github.com/sindresorhus/got/blob/fb5f791defdb6ddb3f01ac5142dde0538c84b864/source/core/index.ts#L2419While
url
is still the correct value, andrequestOptions
also seem to be the correct value, the value ofrequestOrResponse
has set thehost
attribute tolocalhost
instead of the value ofurl
.fn
is in my case equal tohttps.request
, sinceoptions.cache
isundefined
,options.request
isundefined
andisHttps
istrue
.This means the protocol (https) is correctly passed through, however the rest of the url is not.
The text was updated successfully, but these errors were encountered: