Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 1.29 KB

readme.md

File metadata and controls

38 lines (24 loc) · 1.29 KB

auth0-access-token-jwt CI

Verfies and decodes Access Token JWTs loosley following draft-ietf-oauth-access-token-jwt-12

This package is created since the original Auth0 library only exposes express middleware – this makes it impossible to use the jwt verification through Auth0 without express dependency.

If you use something besides express to handle your HTTP requests (like koa, grpc, etc) – it leaves you to create "ugly" workarounds in order to use Auth0.

You can use this package until this issue is corrected.

Install

npm install auth0-access-token-jwt

Usage

import { jwtVerifier } from 'auth0-access-token-jwt';

const token = "your-refresh-token"

const verify = jwtVerifier({
	issuerBaseURL: 'http://issuer.example.com',
	audience: 'https://myapi.com'
})

const auth = await verify(token)

auth.header; // Decoded JWT header
auth.payload; // Decoded JWT payload
auth.token; // Raw JWT token

license

MIT (see the license file)