goharbor/harbor · error

failed to create OIDC provider, error

Error message

failed to create OIDC provider, error: %v

What it means

providerHelper.create failed to construct a go-oidc Provider for the configured OIDC endpoint — the discovery/well-known request errored or returned an unusable document; the underlying error is wrapped. Occurs lazily when get() loads the singleton provider.

Solutions

  1. Verify the OIDC endpoint URL and that /.well-known/openid-configuration is reachable
  2. Check TLS trust: enable verify_cert or add the CA to Harbor's trust store
  3. Confirm network egress from Harbor core to the OIDC provider is allowed
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/pkg/oidc/helper.go:95 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/2828f92d736d71f8. Report an issue: GitHub.

Appendix: source

Thrown at src/pkg/oidc/helper.go:95

			if err := p.create(ctx); err != nil {
				return nil, err
			}
		}
	}

	return p.instance.Load().(*gooidc.Provider), nil
}

func (p *providerHelper) create(ctx context.Context) error {
	s, err := config.OIDCSetting(ctx)
	if err != nil {
		log.Errorf("Failed to get OIDC configuration, error: %v", err)
		return err
	}
	c := clientCtx(ctx, s.VerifyCert)
	provider, err := gooidc.NewProvider(c, s.Endpoint)
	if err != nil {
		return fmt.Errorf("failed to create OIDC provider, error: %v", err)
	}
	err = provider.Claims(&EndpointsClaims)
	if err != nil {
		return err
	}
	p.instance.Store(provider)
	p.creationTime = time.Now()
	return nil
}

var provider = &providerHelper{}

// Used only when an admin disables OIDC certificate verification.
// The default path verifies certificates; this fallback still requires TLS 1.2+.
var insecureTransport = &http.Transport{
	TLSClientConfig: &tls.Config{
		MinVersion:         tls.VersionTLS12,
		InsecureSkipVerify: true, // nolint:gosec // G402: gated by admin-controlled OIDCSetting.VerifyCert

View on GitHub (pinned to 7b2fd08cc5)