✨ feat(auth): OIDC HTTP handlers /start + /callback (ADR-0028 Phase B.4) (#75)
Co-authored-by: Gabriel Radureau <arcodange@gmail.com> Co-committed-by: Gabriel Radureau <arcodange@gmail.com>
This commit was merged in pull request #75.
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/rs/zerolog/log"
|
||||
httpSwagger "github.com/swaggo/http-swagger"
|
||||
|
||||
"dance-lessons-coach/pkg/auth"
|
||||
"dance-lessons-coach/pkg/cache"
|
||||
"dance-lessons-coach/pkg/config"
|
||||
"dance-lessons-coach/pkg/email"
|
||||
@@ -279,6 +280,18 @@ func (s *Server) registerApiV1Routes(r chi.Router) {
|
||||
)
|
||||
mlHandler.RegisterRoutes(r)
|
||||
}
|
||||
|
||||
// OIDC handlers (ADR-0028 Phase B.4)
|
||||
oidcProviders := s.config.GetOIDCProviders()
|
||||
if len(oidcProviders) > 0 {
|
||||
oidcClients := make(map[string]*auth.OIDCClient, len(oidcProviders))
|
||||
for name, p := range oidcProviders {
|
||||
oidcClients[name] = auth.NewOIDCClient(p.IssuerURL, p.ClientID, p.ClientSecret)
|
||||
}
|
||||
redirectBase := s.config.GetMagicLinkConfig().BaseURL
|
||||
oidcHandler := userapi.NewOIDCHandler(oidcClients, s.userService, s.userRepo, redirectBase)
|
||||
oidcHandler.RegisterRoutes(r)
|
||||
}
|
||||
})
|
||||
|
||||
// Register admin routes
|
||||
|
||||
Reference in New Issue
Block a user