README

CleverGo Authentication Middleware

Build Status Coverage Status Go.Dev reference Go Report Card Release

Usage

import (
    "clevergo.tech/auth"
    "clevergo.tech/auth/authenticators"
    "clevergo.tech/authmiddleware"
    "clevergo.tech/clevergo"
)
var store auth.IdentityStore
authenticator := authenticators.NewBasicAuth(store)
app := clevergo.New()
app.Use(authmiddleware.New(authenticator))

Checkout example for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIdentity

func GetIdentity(ctx context.Context) auth.Identity

    GetIdentity retrieves a authenticated identity from context.

    func New

    func New(authenticator auth.Authenticator) clevergo.MiddlewareFunc

      New returns a middleware with the given authenticator.

      Types

      This section is empty.

      Source Files