Comments (10)
Well, this is a Node.js-only module. https://github.com/panva/node-openid-client/blob/main/README.md#how-do-i-use-it-outside-of-nodejs
How do I use it outside of Node.js
It is only built for Node.js. Other javascript runtimes are not supported. I recommend panva/oauth4webapi, or a derivate thereof, if you're looking for a similarly compliant and certified client software that's not dependent on the Node.js runtime builtins.
I can explain what's happening. jose
dependency, which is used to import the JWK key material is a universal library.
So what happens is that Bun resolves jose's bun entrypoint which uses native WebCryptoAPI and ends up with a CryptoKey
, not node's own crypto.KeyObject
. So the check is doing exactly what it should be doing, ensuring it's working with node's crypto KeyObject.
For now I can only say that this module is meant to be used only in Node.js and this is not a bug. That being said, I can look into testing the library in Bun and/or Deno as well but it's not a priority for me.
from node-openid-client.
Hi @BRAVO68WEB
Are you running your code in Node.js, or some other runtime like Bun or Deno?
from node-openid-client.
Bun
Let me check with node too.
from node-openid-client.
Yep, I just now tried with node, it worked.
But, still can tell me why is that check present there?
from node-openid-client.
Thank you @panva for clearing my doubt pretty fast 😸.
from node-openid-client.
@Jarred-Sumner is there anything that can be done to have bun force to resolve a given dependency using a different algorithm (see my comment above)?
from node-openid-client.
I've released https://github.com/panva/node-openid-client/releases/tag/v5.6.0
This attempts to work around:
- missing Node.js APIs in Bun
- Bun's bugs in url.parse(..., true)
- Bun loading
jose
's bun target instead of the require one
It is not possible to run openid-client's test suite due to other Bun Node.js compatibility bugs which is why this is "experimental" and this for now remains a Node.js only module.
Please let me know if you encounter any new issues when running openid-client in Bun.
from node-openid-client.
@panva I will try, and check back to you
from node-openid-client.
Hey @panva it works like a charm.
But currently facing a small issue relates to jose
.
[0.04ms] ".env"
[1] 30000 segmentation fault bun run -b --port 4000 --hot index.ts
I get this error when try to verify JWT with createRemoteJWKSet
and jwtVerify
from jose
.
Waiting for your PR auth0/node-jwks-rsa#374 to get merged, then it will work fine.
from node-openid-client.
unlikely to be jose related, just jose triggered, please open an issue with bun. https://github.com/oven-sh/bun/issues
from node-openid-client.
Related Issues (20)
- Always return an error saying please use an absolute URL HOT 1
- Low-level errors during `Issuer.discover()` cause error without stack trace
- OAuth 2.0 Device Authorization Grant (Device Flow) - poll without PKCE HOT 3
- Type checking httpOptions and rejectUnauthorized
- RPError thrown when IdToken JWE Header enc is blank HOT 2
- client won't run under `edge` runtime HOT 1
- Support setting client_secret to an empty string when using client_secret_basic or client_secret_post HOT 1
- Cannot assign to read only property 'dpopProof' of object '#<Client>' HOT 2
- isKeyObject check fails in Bun HOT 5
- Scope delimiter replace problem HOT 2
- Multiple authenticate requests from the same session causes state mismatch HOT 1
- Can't authenticate when the server advertises authorization_response_iss_parameter_supported HOT 2
- Requests made without Accept-Encoding header HOT 1
- "cty" should not be included in jwks query HOT 2
- URL is not a constructor at Issuer.request HOT 1
- Application and Identity manger on different domains HOT 1
- Support other status code than 200 HOT 4
- Unable to use private_key_jwt auth method with Azure.
- Audience matching doesn't work as intended HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-openid-client.