Skip to content

Comments

Fix exporting jwk#4207

Open
NoelDeMartin wants to merge 1 commit intoinrupt:mainfrom
NoelDeMartin:extractable-keys
Open

Fix exporting jwk#4207
NoelDeMartin wants to merge 1 commit intoinrupt:mainfrom
NoelDeMartin:extractable-keys

Conversation

@NoelDeMartin
Copy link
Contributor

In the core package, a key pair is generated without the extractable parameter and then is exported using exportJWK.

According to the documentation (node, browser), this shouldn't be possible and I was getting a error saying "non-extractable CryptoKey cannot be exported as a JWK". Then I wondered how this ever worked in the first place... Apparently, running this with node doesn't throw an error, but I was using bun which does.

In this case, it seems like the incorrect behaviour is Node's, so we should be using the extractable config. Just to made sure, I verified that my fix works in both runtimes.

@NoelDeMartin NoelDeMartin requested a review from a team as a code owner February 19, 2026 06:37
@NSeydoux
Copy link
Contributor

This is 100% on top of head, but I thought the extractable parameter applied to the private key, and the exportJWK would be used to serialize the public key for the DPoP header. I'll double check, but the change looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants