callback

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package callback contains reusable HTTP helpers for browser based authn callback flows. It depends only on Kernel authn contracts, not on Casdoor SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Login  authn.LoginService
	Logger logx.Logger
	// LoginURL is optional. When it is set, a browser request to the callback
	// endpoint without a code is redirected to the provider login URL instead of
	// returning a raw JSON error. This makes local integration tests and real web
	// app flows friendlier while keeping the provider hidden behind authn.LoginService.
	LoginURL      string
	RedirectURI   string
	ExpectedState string
	OrgID         string
	AppID         string
	SuccessText   string
	OnSuccess     func(context.Context, authn.CallbackResult) error
}

Handler exchanges OAuth/OIDC callback code values through authn.LoginService. It is provider-neutral: Casdoor is only one possible implementation behind the service interface.

func (*Handler) ServeHTTP

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

Jump to

Keyboard shortcuts

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