0.0.7 • Published 8 months ago

@byu-oit/jwt v0.0.7

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

@byu-oit/jwt

Provides helpful functions to retrieve a specified BYU .well-known URL and verify BYU signed JWTs.

Usage

import { ByuJwt } from '@byu-oit/jwt'

const byuJwt = new ByuJwt({ issuer: 'https://api.byu.edu' })

const jwt = byuJwt.verify('[your jwt]')

/** Access the jwt payload information */
const { byuId } = jwt.payload

/** Access the jwt header information */
const { alg } = jwt.header

Note Please refer to the API documentation if you need to see what information is made available in the jwt payload or header.

Options

propertytypedefaultdescription
issuerstringundefinedThe OAuth Provider host, e.g. https://api.byu.edu. Either the issuer or the discoveryEndpoint are required but not both. If the discoveryEndpoint is not provided, the issuer will be used to specify the open id configuration.
discoveryEndpointstringundefinedCan specify the discoveryEndpoint explicitly if your open id configuration is not located at /.well-known/openid-configuration. Either the issuer or the discoveryEndpoint are required but not both.
keystringundefinedA JWK in the form of a PEM Certificate that will be used to verify the JWT.
additionalValidationsarrayundefinedAn array of additional validation functions that can be run when verify() is called. Each function should accept a decoded jwt as its parameter, throw an error if the validation fails, and return void if it succeeds.

There are additional options that can be passed in that are all listed under the fast-jwt VerifierOptions properties. Descriptions of these properties can be found here.

0.0.7-beta.2

8 months ago

0.0.7-beta.0

8 months ago

0.0.7-beta.1

8 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.7

8 months ago

0.0.6

11 months ago

0.0.3

12 months ago

0.0.1

1 year ago

0.0.2

1 year ago

0.0.1-beta.3

1 year ago

0.0.1-beta.2

1 year ago

0.0.1-beta.1

1 year ago

0.0.1-beta.0

1 year ago