Skip to content

Plug-and-Play middleware to secure your fiber API with auth0 🧬

Notifications You must be signed in to change notification settings

Mechse/fiberauth0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fiberauth0

A plug-and-play middleware to secure your fiber API with auth0

Usage

The go script loads the 2 important Statements from an ".env" file which has to be in project path.

AUDIENCE=http://localhost:3000
AUTHORITY=https://dev-xxxxxx.eu.auth0.com/

Simple example

package main

import (
   fiberauth0 "github.com/Mechse/fiberauth0"
   fiber "github.com/gofiber/fiber"
)

func helloWorld(c *fiber.Ctx) {
   c.Send("Welcome to this protected root.")
}

func main() {
   app := fiber.New()
   app.Get("/", fiberauth0.Protected(), helloWorld)
   app.Listen(3000)
}

About

Plug-and-Play middleware to secure your fiber API with auth0 🧬

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages