nearform / fastify-auth0-verify

Auth0 verification plugin for Fastify
97 stars 24 forks source link
hacktoberfest

fastify-auth0-verify

Package Version ci

Auth0 verification plugin for Fastify.

Internally this is a lighweight wrapper around fastify-jwt-jwks and accepts most of the same options. The differences are highlighted in this document. Refer to the documentation in the fastify-jwt-jwks repository for general usage.

Installation

Just run:

npm install fastify-auth0-verify --save

Usage

The configuration options for this plugin are similar to those in fastify-jwt-jwks, except that this package accepts a domain option instead of jwksUrl:

Contributing

See CONTRIBUTING.md

Developer notes

Tests

Tests are currently split into unit and integration. Integration tests need the following environment variables:

Env var
AUTH0_DOMAIN Auth0 dashboard -> application -> Settings -> Domain
AUTH0_CLIENT_ID Auth0 dashboard -> application -> Settings -> Client ID
AUTH0_CLIENT_SECRET Auth0 dashboard -> application -> Settings -> Client Secret
AUTH0_API_AUDIENCE Auth0 application identifier

License

Copyright NearForm Ltd. Licensed under the Apache-2.0 license.