go.bigb.es/curator

v1.3.4
Doc Versions Source

Types

T type Provider

src
type Provider struct {
	// contains filtered or unexported fields
}

Provider handles OIDC authentication for the admin UI.

f func New

src
func New(ctx context.Context, cfg *config.OIDCConfig, clientSecret string) (*Provider, error)

New creates an OIDC provider by performing discovery on the issuer.

m func (*Provider) CallbackHandler

src
func (p *Provider) CallbackHandler(w http.ResponseWriter, r *http.Request)

CallbackHandler handles the OIDC callback, exchanges the code, and sets a session cookie.

m func (*Provider) LoginHandler

src
func (p *Provider) LoginHandler(w http.ResponseWriter, r *http.Request)

LoginHandler redirects to the OIDC provider's authorization endpoint.

m func (*Provider) LogoutHandler

src
func (p *Provider) LogoutHandler(w http.ResponseWriter, r *http.Request)

LogoutHandler clears the session cookie and redirects to the admin login.

m func (*Provider) ValidateSession

src
func (p *Provider) ValidateSession(value string) string

ValidateSession verifies an HMAC-signed session cookie value. Returns the email on success or an empty string on failure.

Source Files