class UnsecuredJWT
extends ProduceJWT
import { UnsecuredJWT } from "https://deno.land/x/jose@v4.13.0/jwt/unsecured.ts";
The UnsecuredJWT class is a utility for dealing with { "alg": "none" }
Unsecured JWTs.
Examples
Encoding
Encoding
const unsecuredJwt = new jose.UnsecuredJWT({ 'urn:example:claim': true })
.setIssuedAt()
.setIssuer('urn:example:issuer')
.setAudience('urn:example:audience')
.setExpirationTime('2h')
.encode()
console.log(unsecuredJwt)
Decoding
Decoding
const payload = jose.UnsecuredJWT.decode(jwt, {
issuer: 'urn:example:issuer',
audience: 'urn:example:audience',
})
console.log(payload)
Static Methods
decode(jwt: string, options?: JWTClaimVerificationOptions): UnsecuredResult
Decodes an unsecured JWT.