Skip to content

Support HTTP Basic authentication for OpenAPI tools #5492

@aashnakunk

Description

@aashnakunk

Describe the Bug:
OpenAPI tools currently do not support HTTP Basic authentication. When an OpenAPI auth credential contains HTTP username/password credentials, ADK raises NotImplementedError("Basic Authentication is not supported.") instead of generating a standard Basic auth Authorization header.

Steps to Reproduce:

  1. Use ADK OpenAPI tools with an OpenAPI security scheme that requires HTTP Basic auth.
  2. Configure an AuthCredential with HTTP credentials containing username and/or password.
  3. Run the OpenAPI tool auth helper path.
  4. ADK raises:
NotImplementedError: Basic Authentication is not supported.
Expected Behavior:
ADK should support HTTP Basic auth for OpenAPI tools by generating an authorization header in the standard format:

text

Authorization: Basic base64(username:password)
Observed Behavior:
The current implementation explicitly raises NotImplementedError for HTTP credentials with username/password.

Relevant source location:

python

# src/google/adk/tools/openapi_tool/auth/auth_helpers.py
raise NotImplementedError("Basic Authentication is not supported.")
Environment Details:

ADK Library Version (pip show google-adk): main branch / current source checkout
Desktop OS: macOS
Python Version (python -V): N/A
Model Information:

Are you using LiteLLM: No
Which model is being used: N/A
🟡 Optional Information
Regression:
N/A

Logs:

text

NotImplementedError: Basic Authentication is not supported.
Screenshots / Video:
N/A

Additional Context:
HTTP Basic authentication is part of the OpenAPI HTTP security scheme family and is still used by some APIs. ADK already handles bearer-style HTTP credentials by generating an internal Authorization header. Basic auth could follow the same pattern, using Authorization: Basic <base64(username:password)>.

A possible implementation would:

Detect HTTP credentials with username/password.
Encode username:password with base64.
Return an internal Authorization header parameter and kwargs, similar to bearer token handling.
Add unit tests in tests/unittests/tools/openapi_tool/auth/test_auth_helper.py.
Minimal Reproduction Code:

python

# Conceptual repro based on current source behavior.
# The relevant code path is in:
# src/google/adk/tools/openapi_tool/auth/auth_helpers.py

# When auth_credential.auth_type == AuthCredentialTypes.HTTP
# and auth_credential.http.credentials.username/password are set,
# the helper currently raises:
# NotImplementedError("Basic Authentication is not supported.")


How often has this issue occurred?:

Always (100%)





Metadata

Metadata

Labels

auth[Component] This issue is related to authorizationrequest clarification[Status] The maintainer need clarification or more information from the author

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions