oauth

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAbsoluteURL

func GetAbsoluteURL(r *http.Request, path string) string

Types

type Config

type Config struct {
	GoogleClientID     string
	GoogleClientSecret string
	GoogleRedirectURL  string

	OIDCIssuer       string
	OIDCClientID     string
	OIDCClientSecret string
	OIDCRedirectURL  string

	AuthSuccessRedirect string
}

Config holds OAuth/OIDC provider configuration.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler bundles OAuth handlers for providers.

func NewHandler

func NewHandler(store *storage.Store, logger *logrus.Logger, cfg Config, sessStore sessions.SessionStore, issue IssueTokenFunc) *Handler

NewHandler constructs Handler.

func (*Handler) GoogleEnabled

func (h *Handler) GoogleEnabled() bool

func (*Handler) HandleGoogleCallback

func (h *Handler) HandleGoogleCallback(w http.ResponseWriter, r *http.Request)

func (*Handler) HandleGoogleLogin

func (h *Handler) HandleGoogleLogin(w http.ResponseWriter, r *http.Request)

func (*Handler) HandleOIDCCallback

func (h *Handler) HandleOIDCCallback(w http.ResponseWriter, r *http.Request)

func (*Handler) HandleOIDCLogin

func (h *Handler) HandleOIDCLogin(w http.ResponseWriter, r *http.Request)

func (*Handler) OIDCEnabled

func (h *Handler) OIDCEnabled() bool

type IssueTokenFunc

type IssueTokenFunc func(w http.ResponseWriter, r *http.Request, userID string) error

IssueTokenFunc issues app JWT and refresh token for the given user ID.

Jump to

Keyboard shortcuts

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