chroma-core/chroma · error · AuthError

Invalid Authorization header format

Error message

Invalid Authorization header format

What it means

Error "Invalid Authorization header format" thrown in chroma-core/chroma.

Source

Thrown at chromadb/auth/basic_authn/__init__.py:115

                    "Usernames must be unique."
                )
            self._creds[username] = SecretStr(password)

    @trace_method(
        "BasicAuthenticationServerProvider.authenticate", OpenTelemetryGranularity.ALL
    )
    @override
    def authenticate_or_raise(self, headers: Dict[str, str]) -> UserIdentity:
        try:
            if AUTHORIZATION_HEADER.lower() not in headers.keys():
                raise AuthError(AUTHORIZATION_HEADER + " header not found")
            _auth_header = headers[AUTHORIZATION_HEADER.lower()]
            _auth_header = re.sub(r"^Basic ", "", _auth_header)
            _auth_header = _auth_header.strip()

            base64_decoded = base64.b64decode(_auth_header).decode("utf-8")
            if ":" not in base64_decoded:
                raise AuthError("Invalid Authorization header format")
            username, password = base64_decoded.split(":", 1)
            username = str(username)  # convert to string to prevent header injection
            password = str(password)  # convert to string to prevent header injection
            if username not in self._creds:
                raise AuthError("Invalid username or password")

            _pwd_check = bcrypt.checkpw(
                password.encode("utf-8"),
                self._creds[username].get_secret_value().encode("utf-8"),
            )
            if not _pwd_check:
                raise AuthError("Invalid username or password")
            return UserIdentity(user_id=username)
        except AuthError as e:
            logger.error(
                f"BasicAuthenticationServerProvider.authenticate failed: {repr(e)}"
            )
        except Exception as e:

View on GitHub (pinned to aecdd12c8a)

When it happens

Trigger: Thrown at chromadb/auth/basic_authn/__init__.py:115 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16). Data as JSON: /api/errors/cdf7b1268932a3ac. Report an issue: GitHub.