Skip to content

Fenny/keyauth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Key Authentication

Release Discord Test Security Linter

Special thanks to József Sallai & Ray Mayemir

Install

go get -u github.com/gofiber/fiber
go get -u github.com/gofiber/keyauth

Example

package main

import (
  "github.com/gofiber/fiber"
  "github.com/gofiber/keyauth"
)

func main() {
  app := fiber.New()
  
  app.Use(keyauth.New(keyauth.Config{
    TokenLookup: "cookie:access_token",
    ContextKey: "my_token"
  }))
  
  app.Get("/", func(c *fiber.Ctx) {
    c.Send(c.Locals("my_token"))
  })
  
  app.Listen(3000)
}

Test

curl -v --cookie "access_token=hello_world" http://localhost:3000

About

🧬 Key Authentication for Fiber

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages

  • Go 100.0%