Repository navigation
Support HTTP Basic authentication for OpenAPI tools #5492
Copy link
Copy link
Closed
Labels
auth[Component] This issue is related to authorization[Component] This issue is related to authorizationrequest clarification[Status] The maintainer need clarification or more information from the author[Status] The maintainer need clarification or more information from the author
Description
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:
- Use ADK OpenAPI tools with an OpenAPI security scheme that requires HTTP Basic auth.
- Configure an
AuthCredentialwith HTTP credentials containingusernameand/orpassword. - Run the OpenAPI tool auth helper path.
- 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%)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
auth[Component] This issue is related to authorization[Component] This issue is related to authorizationrequest clarification[Status] The maintainer need clarification or more information from the author[Status] The maintainer need clarification or more information from the author
Activity
klateefa commentedon Apr 29, 2026
@aashnakunk Basic
authis currently blocked in the code by aNotImplementedError, so no authentication header is sent. Instead of throwing this error, the code can simply take theusername and password, combine them, encode them in base64, and send them in theAuthorization header. This follows the standard approach and fits smoothly with howauthenticationis already handled.This PR addresses the issue #5493 Please Check and Let me know if anything is required
Thank you.
surajksharma07 commentedon May 27, 2026
@aashnakunk — just following up here. The fix approach is correct — the NotImplementedError in auth_helpers.py should be replaced with a standard base64-encode of username:password sent as the Authorization: Basic header, and both your PR #5493 and community PR #5535 by @Oppong08 are targeting exactly this.
The fix hasn't landed in a released ADK version yet, so anyone hitting this in the meantime should keep an eye on those PRs.
Since we haven't heard back since klateefa's comment, going ahead and closing this out — feel free to reopen if neither PR covers your use case or if you have additional context to share!
fix: support openapi basic auth