auth

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(cfg *Config, logger *zap.Logger) fiber.Handler

Middleware creates a new authentication middleware

Types

type Config

type Config struct {
	// TenantID is the Azure AD tenant ID
	TenantID string `yaml:"tenantId"`

	// ClientID is the Azure AD application (client) ID
	ClientID string `yaml:"clientId"`

	// Authority is the Azure AD authority URL (e.g., https://login.microsoftonline.com/{tenantId})
	Authority string `yaml:"authority"`

	// AllowedAudiences is a list of allowed audience values in the token
	AllowedAudiences []string `yaml:"allowedAudiences"`

	// EnableManagedIdentity enables managed identity authentication
	EnableManagedIdentity bool `yaml:"enableManagedIdentity"`

	// EnableServicePrincipal enables service principal authentication
	EnableServicePrincipal bool `yaml:"enableServicePrincipal"`

	// EnableUserAuthentication enables user authentication
	EnableUserAuthentication bool `yaml:"enableUserAuthentication"`
}

Config holds the Azure AD authentication configuration

func NewConfig

func NewConfig() *Config

NewConfig creates a new Config instance with default values

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL