22 lines
624 B
Go
22 lines
624 B
Go
package api
|
|
|
|
import "github.com/gofiber/fiber/v2"
|
|
|
|
func registerSAMLAuthRoutes(v1 fiber.Router, samlHandler interface {
|
|
HandleLogin(*fiber.Ctx) error
|
|
HandleSAMLCallback(*fiber.Ctx) error
|
|
HandleSLO(*fiber.Ctx) error
|
|
HandleMetadata(*fiber.Ctx) error
|
|
HandleLogout(*fiber.Ctx) error
|
|
}) {
|
|
if samlHandler == nil {
|
|
return
|
|
}
|
|
auth := v1.Group("/auth")
|
|
auth.Get("/login", samlHandler.HandleLogin)
|
|
auth.Post("/saml/callback", samlHandler.HandleSAMLCallback)
|
|
auth.Post("/saml/logout", samlHandler.HandleSLO)
|
|
auth.Get("/saml/metadata", samlHandler.HandleMetadata)
|
|
auth.Post("/saml/app-logout", samlHandler.HandleLogout)
|
|
}
|