openid

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidState = errors.New("invalid state parameter")
	ErrUserInactive = errors.New("user account is inactive")
)

Functions

func ToUserResponse

func ToUserResponse(user *model.User) *types.UserResponse

Types

type Provider

type Provider interface {
	GetAuthURL(state string) string
	Exchange(ctx context.Context, code string) (*oauth2.Token, error)
	VerifyIDToken(ctx context.Context, rawIDToken string) (*oidc.IDToken, error)
	GetUserInfo(ctx context.Context, token *oauth2.Token, idToken *oidc.IDToken) (*UserInfo, error)
}

func NewProvider

func NewProvider(ctx context.Context, cfg *config.OpenIDConfig) (Provider, error)

type Service

type Service interface {
	BeginAuth() (authURL string, state string, err error)
	CompleteAuth(ctx context.Context, code, state, expectedState string) (*model.User, *types.TokenPair, error)
}

func NewService

func NewService(provider Provider, userService flectoService.UserService, jwtService *jwt.ServiceJWT) Service

type UserInfo

type UserInfo struct {
	Subject   string
	Email     string
	FirstName string
	LastName  string
	Name      string
	Roles     []string
}

Jump to

Keyboard shortcuts

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