auth

package
v0.0.0-...-f6f2a49 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenNotPresentInHeader error = errors.New("token in header 'Authorization' not found")
)

Functions

func AuthEndpoints

func AuthEndpoints(r *gin.Engine) *gin.RouterGroup

func JwtAuthMiddleware

func JwtAuthMiddleware() gin.HandlerFunc

Types

type JwtClaimNeeded

type JwtClaimNeeded struct {
	Email             string `json:"email"`
	Name              string `json:"name"`
	PreferredUsername string `json:"preferred_username"`
}

func ValidateToken

func ValidateToken(c *gin.Context) (claims *JwtClaimNeeded, err error)

type OAuth2Config

type OAuth2Config struct {
	Type     OAuth2ConfigAuthType `json:"type" binding:"required"`
	Scope    string               `json:"scope" binding:"required"`
	Issuer   string               `json:"issuer" binding:"required"`
	ClientID string               `json:"client_id" binding:"required"`
}

type OAuth2ConfigAuthType

type OAuth2ConfigAuthType string
const AzureAD OAuth2ConfigAuthType = "azure_ad"
const Default OAuth2ConfigAuthType = "default"

Jump to

Keyboard shortcuts

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