auth

package
v0.0.0-...-19d8e19 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const NAME = "department"
View Source
const USER_ID = "uid"

Variables

View Source
var (
	OAuthConfig  *oauth2.Config
	OidcProvider *oidc.Provider
	OidcVerifier *oidc.IDTokenVerifier
)

Functions

func GenerateJWT

func GenerateJWT(sub string, dept string, rol string) (token string, err error)

func InitOIDCConfig

func InitOIDCConfig(providerUrl string, clientId string, clientSecret string, redirectUrl string, scopes string) error

func Login

func Login(username, password string) (*model.User, error)

Types

type Claims

type Claims struct {
	jwt.RegisteredClaims
	Sub        string `json:"sub"`
	Department string `json:"department"`
	Role       string `json:"role"`
}

func ParseToken

func ParseToken(token string) (Claims, error)

Jump to

Keyboard shortcuts

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