Open joshbalfour opened 1 year ago
Weirdly i found this did work when using ProjectAPI from "@ory/client": "^1.1.21"
Hi, thanks for the report. When working with the Ory Network, we recommend using the @ory/client
package. @ory/hydra-client
is meant to be used with standalone Hydra instances.
Though, I also only got that working when using the accessToken
parameter, not apiKey
.
Also, just noticed that this report is a month old, sorry for the delay.
I see this in @ory/kratos-client as well. We self-host so do not use @ory/client. Periodically the token does not get added to requests. I've not been able to track down what specifically causes this though.
I encountered the same issue while switching from @ory/kratos-client
to @ory/client
: the apiKey
parameter is ignored and we have to use the accessToken
with a project API key instead.
Why is there two parameters, and why apiKey
does not accept the actual API given by Ory?
There are no example in your documentation showing how to use the SDKs, so it's virtually impossible to know without searching in this repo' issues...
You need to use the accessTokenKey :)
Preflight checklist
Describe the bug
apiKey/accessToken does not get added to the request when using the typescript SDK, resulting in admin calls rejecting as unauthorised.
You can work around it if you set the baseOptions to specify the header yourself.
Reproducing the bug
Relevant log output
Relevant configuration
No response
Version
"@ory/hydra-client": "^2.0.2"
On which operating system are you observing this issue?
Ory Network
In which environment are you deploying?
Ory Network
Additional Context
No response