Categorygithub.com/devrijal/echo-jwt-middleware
modulepackage
0.1.0
Repository: https://github.com/devrijal/echo-jwt-middleware.git
Documentation: pkg.go.dev

# README

Echo JWT Middleware Function Helper

This package provide JWT authentiacation based on openid protocol

Import package

go get github.com/devrijal/echo-jwt-middleware

Environment Variables

Make sure you have the following variable exported

  • OPENID_PROVIDER_ENDPOINT
  • OPENID_PROVIDER_DISCOVERY_ENDPOINT

for example:

OPENID_PROVIDER_ENDPOINT=http://sso.company.com/realms/myrealm
OPENID_PROVIDER_DISCOVERY_ENDPOINT=http://sso.company.com/realms/myrealm/.well-known/openid-configuration

Usage

jwtmiddleware "github.com/devrijal/echo-jwt-middleware"
echojwtmiddleware "github.com/devrijal/echo-jwt-middleware/echo"
echojwt "github.com/labstack/echo-jwt/v4"

e := echo.New()

e.Use(
    echojwt.WithConfig(
        echojwt.Config{
		    Skipper: echojwtmiddleware.Skipper([]string{"docs"}),
		    KeyFunc: jwtmiddleware.GetMatchedKey,
        }
    )
)

# Functions

Find matched keys for the given token.
No description provided by the author
Get public keys from openid discovery endpoints.
Extract token from echo.Context.
Generic middleware.
Echo middleware.Skipper implementation.

# Variables

Echo jwt.Keyfunc implementation.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author