Skip to content

Add support for HS256 algorithm to JWKSet #368

Answered by panva
philippemiguet asked this question in Q&A
Discussion options

You must be logged in to vote

The createLocalJWKSet and createRemoteJWKSet functions return a get key function configured to resolve a single public key from a JSON Web Key Set, the use case for these is (pre-)fetching public keys from third party servers for JWS JWT verification, in these scenarios only public keys must be present in the JWKS. That's why these two functions do not and will not support symmetric keys (and therefore algorithms).

From the jwtVerify documentation you can see that this get key function is something you can construct yourself following this interface. And it is as simple as the following snippet if you only want to do symmetric algorithms.

import * as jose from 'jose'

// two 32 random byt…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@philippemiguet
Comment options

Answer selected by philippemiguet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants