oidc-jwks-verify
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

oidc-jwks-verify

Coverage Status npm version

Code inspired from express-oidc-jwks-verify. The reason why this project exists was for my project that needed to connect and validate the JWT token without using the express library.

Scenario

  1. Server is having a Validation Key to validate the user tokens (AddValidationKey in IdentityServer)
  2. The client want to validate the token against the server (basically a key check)
  3. We validate the id_token and then consider the user really authenticated

Installation [Not yet deployed as a npm package]

The installation is simple:

npm install oidc-jwks-verify

Usage

import { VerifyOidc, VerifyStatusCode } from 'oidc-jwks-verify'
let oidcValidator = new VerifyOidc({ issuer: `http://localhost:5000` })
 
// Somewhere in your code
oidcValidator.verify(accessToken).then((result: VerifyStatusCode) => {
  // Result returns [Authorized|Unauthorized|Unknown] (Unknown should never happen)
  console.log(result)
})

When building locally

Build Dependencies

Package: x509

License

MIT (Enjoy)

Package Sidebar

Install

npm i oidc-jwks-verify

Weekly Downloads

4

Version

0.1.1

License

MIT

Last publish

Collaborators

  • nordes