How to use @foal/jwks-rsa - 1 common examples

To help you get started, we’ve selected a few @foal/jwks-rsa examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FoalTS / foal / packages / acceptance-tests / src / authentication / jwt.jwks.spec.ts View on Github external
+ 'GCKIQ0_btqK-jFunT2NBC8RItanDZpptQ',
          use: 'sig',
        }
      ]
    };

    class AppController {

      @Get('/.well-known/jwks.json')
      getJWKS() {
        return new HttpResponseOK(jwks);
      }

      @Get('/api/users/me')
      @JWTRequired({
        secretOrPublicKey: getRSAPublicKeyFromJWKS({
          jwksUri: 'http://localhost:3000/.well-known/jwks.json'
        })
      })
      getUser() {
        return new HttpResponseOK({
          name: 'Alix'
        });
      }

    }

    server = createApp(AppController).listen(3000);

    try {
      const response = await superagent
        .get('http://localhost:3000/api/users/me')

@foal/jwks-rsa

Integration of the library jwks-rsa with FoalTS

MIT
Latest version published 26 days ago

Package Health Score

81 / 100
Full package analysis

Popular @foal/jwks-rsa functions