🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

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

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

v0.0.0-20220408142446-3d452cd053da
Source
Go
Version published
Created
Source

go-echo-auth0-middleware

Auth0 Middleware for go labstack/echo

Example

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://<your tenant domain>/",
		Audience: []string{"<your api identifier>"},
	}))

	// 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"))
}

FAQs

Package last updated on 08 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts