Skip to content

Commit

Permalink
fix: if one oidc verifier is failing, do not let the whole API fail (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kuannie1 authored Jan 13, 2025
1 parent 0368e3f commit 6f71d32
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/pkg/request/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,15 @@ func MakeVerifierFromConfig(ctx context.Context, cfg *setup.Configuration) OIDCV
for _, provider := range cfg.Auth.Providers {
verifier, err := MakeOIDCProvider(ctx, provider.IssuerURL, provider.ClientID, DefaultClaimsVerifier)
if err != nil {
logrus.Errorf("failed to create OIDC verifier with error: %s", err.Error())
logrus.Warnf("failed to create OIDC verifier with Issuer URL %s and clientID %s with error: %s", provider.IssuerURL, provider.ClientID, err.Error())
continue
}
verifiers = append(verifiers, verifier)
}

if len(verifiers) == 1 {
logrus.Error("only one OIDC verifier configured.")
}
logrus.Infof("%d OIDC verifiers configured", len(verifiers))
return MakeMultiOIDCVerifier(verifiers...)
}

Expand Down

0 comments on commit 6f71d32

Please sign in to comment.