Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/satishbabariya/go-echo-auth0-middleware

Auth0 Middleware for go labstack/echo
https://github.com/satishbabariya/go-echo-auth0-middleware

auth0 auth0-jwt echo-framework golang jwt jwt-authentication middleware

Last synced: 3 months ago
JSON representation

Auth0 Middleware for go labstack/echo

Awesome Lists containing this project

README

        

# go-echo-auth0-middleware
Auth0 Middleware for go labstack/echo

### Example
```go
package main

import (
"net/http"

"github.com/auth0/go-jwt-middleware/v2/validator"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
goechoauth0middleware "github.com/satishbabariya/go-echo-auth0-middleware"
)

func main() {
e := echo.New()

e.Use(middleware.Logger())
e.Use(middleware.Recover())

e.Use(goechoauth0middleware.Auth0WithConfig(goechoauth0middleware.Auth0Config{
Issuer: "https:///",
Audience: []string{""},
}))

// Routes
e.GET("/", func(c echo.Context) error {
claims := c.Get("claims").(*validator.ValidatedClaims)
return c.JSON(http.StatusOK, claims)
})

// Start server
e.Logger.Fatal(e.Start(":3000"))
}
```