Skip to content
A port of auth0/jsonwebtoken for Deno
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
src
.darnrc.json
.gitignore
README.md
mod.ts

README.md

[WIP] JWT

A port of auth0/jsonwebtoken using jsrsasign's jws library.

NOTICE: this is very much a work in progress until it reaches 1.0 status

https://img.shields.io/github/tag/denoserverless/jwt.svg?label=release

// example.ts
import { sign, SignPayload } from "https://cdn.jsdelivr.net/gh/denoserverless/jwt/mod.ts";

const payload: SignPayload = {
  greeting: "world",
};

const jwt = sign({}, payload, "hello");

console.log(jwt);
deno ./example.ts
# eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJncmVldGluZyI6IndvcmxkIn0.I5gqoVkPztoa07kuWyYWSA5uxg7JbdXqt066gFubX1o

Roadmap

  • Proof of Concept sign with jsrsasign
  • Proof of Concept decode with jsrsasign
  • Proof of Concept verify with jsrsasign
  • Fully implement sign, decode, verify
  • Optional: move away from jsrsasign (it's slow)
  • Eventually: move cryptography to Deno's built in cryptography

Changelog

0.1.0

feat: implement barebones sign function

  • Slight modifications to jsrsasign:
    • removed declaration of 'crypto' for Deno
    • removed declaration of window
    • edited exports to only export jws namespace
  • barebones sign function
  • typings for header (JwtHeader) and payload (SignPayload)
You can’t perform that action at this time.