goharbor/harbor · error

bearer auth scheme isn't supported

Error message

bearer auth scheme isn't supported: %v

What it means

Returned by getRealmService when the registry's /v2/ response advertises no 'bearer' auth challenge among its WWW-Authenticate headers. Without a bearer realm and service, token-based auth for VolcEngine CR cannot be set up, so the helper reports the unsupported auth configuration. It fires when the endpoint is not a VolcEngine CR registry or auth is misconfigured.

Solutions

  1. Verify the registry URL points to a VolcEngine CR endpoint that requires bearer token auth
  2. Inspect the /v2/ response WWW-Authenticate challenges
  3. Confirm the registry is reachable and not behind a proxy stripping auth headers
  4. Use the correct adapter if the registry uses basic auth
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/pkg/reg/adapter/volcenginecr/helper.go:72 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/25eb281471b2b0b9. Report an issue: GitHub.

Appendix: source

Thrown at src/pkg/reg/adapter/volcenginecr/helper.go:72

		Transport: util.GetHTTPTransport(insecure, caCert),
		Timeout:   config.RegistryHTTPClientTimeout(),
	}

	// Allow tests to override the host (e.g., inject mock server URL) via resolveHost
	host = resolveHost(host)

	resp, err := client.Get(host + "/v2/")
	if err != nil {
		return "", "", err
	}
	defer resp.Body.Close() // nolint
	challenges := challenge.ResponseChallenges(resp)
	for _, challenge := range challenges {
		if challenge.Scheme == "bearer" {
			return challenge.Parameters["realm"], challenge.Parameters["service"], nil
		}
	}
	return "", "", fmt.Errorf("bearer auth scheme isn't supported: %v", challenges)
}

View on GitHub (pinned to 7b2fd08cc5)