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

How do I use RS256 signed token with this package? #15

Open
bearzk opened this issue Apr 1, 2020 · 1 comment
Open

How do I use RS256 signed token with this package? #15

bearzk opened this issue Apr 1, 2020 · 1 comment
Assignees

Comments

@bearzk
Copy link

bearzk commented Apr 1, 2020

I'm required to use RS256 for a project.

there will be jwks endpoint like this https://domain-name.auth0.com/.well-known/jwks.json

I tried to pass the key from jwksUri into the the strategy options like following, it doesn't work, how should I use RS256 signed JWT here?

server.auth.strategy('jwt', 'hapi-now-auth', {
    verifyJWT: true,
    keychain: [jwksRsa.hapiJwt2Key({
      cache: true,
      jwksUri,
    })],
    verifyOptions: {
      algorithms: ['RS256']
      audience,
    },
    validate: async (req, token, h) => {}
    ...
@puchesjr
Copy link
Member

puchesjr commented May 19, 2020

We apologize for the delay. We currently take the keys in the keychain as strings which you can obtain by using the jwksRsa client but we will look into adding a function passed to verify the keys too.

@puchesjr puchesjr self-assigned this May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants