Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support JSON Web Key Sets (JWKS) #57

Closed
grempe opened this issue Aug 20, 2021 · 3 comments
Closed

Feature Request: Support JSON Web Key Sets (JWKS) #57

grempe opened this issue Aug 20, 2021 · 3 comments

Comments

@grempe
Copy link

grempe commented Aug 20, 2021

Supporting the retrieval and use of JWKS public keys would be very helpful. This would allow secure use of public key JWT signatures provided by Auth0, Okta, and other JWKS providers. This would allow client or server side tools to validate JWT's signed by Auth0, Okta, and other identity providers.

https://auth0.com/docs/tokens/json-web-tokens/json-web-key-sets
https://developer.okta.com/code/dotnet/jwt-validation/

Here's a sample of a live JWKS keyset:

https://login.truestamp.com/.well-known/jwks.json

Here is a similar project from Auth0 that pulls in a JWKS set for use in their Node Express lib that might provide inspiration for the API:

https://github.com/auth0/node-jwks-rsa

@panva
Copy link

panva commented Aug 20, 2021

@grempe As soon as the appropriate WebCryptoAPIs (SubtleCrypto.importKey) land in Deno you'll be able to do

import { createRemoteJWKSet, jwtVerify } from 'https://deno.land/x/jose@VERSION/index.ts'

const JWKS = createRemoteJWKSet(new URL('https://login.truestamp.com/.well-known/jwks.json'))

async function verify(jwt: string) {
  const { payload, protectedHeader } = await jwtVerify(jwt, JWKS, {
    issuer: 'urn:example:issuer',
    audience: 'urn:example:audience'
  })
  return { payload, protectedHeader }
}

@grempe
Copy link
Author

grempe commented Aug 20, 2021

Thanks @panva for the comment and example. I will keep an eye on your JOSE implementation and its Deno support.

@timonson
Copy link
Member

Thanks @panva ! I would recommend using https://deno.land/x/jose for more complex applications.

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

No branches or pull requests

3 participants