initial work on OIDC (SSO) integration

This commit is contained in:
Raal Goff 2021-09-26 16:53:05 +08:00
parent 83815f567d
commit e7a2501fe8
6 changed files with 347 additions and 4 deletions

6
app.go
View file

@ -45,6 +45,10 @@ type Config struct {
TLSKeyPath string
DNSConfig *tailcfg.DNSConfig
OIDCEndpoint string
OIDCClientID string
OIDCClientSecret string
}
// Headscale represents the base app of the service
@ -168,6 +172,8 @@ func (h *Headscale) Serve() error {
r.GET("/register", h.RegisterWebAPI)
r.POST("/machine/:id/map", h.PollNetMapHandler)
r.POST("/machine/:id", h.RegistrationHandler)
r.GET("/oidc/register/:mKey", h.RegisterOIDC)
r.GET("/oidc/callback", h.OIDCCallback)
var err error
timeout := 30 * time.Second