Skip to content

Support HTTP Basic authentication for OpenAPI tools #5492

Closed

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%)





Activity

  1. added
    auth[Component] This issue is related to authorization
    on Apr 26, 2026
  2. added theissue type on Apr 26, 2026
  3. klateefa commented on Apr 29, 2026

    @klateefa

    @aashnakunk Basic auth is currently blocked in the code by a NotImplementedError, so no authentication header is sent. Instead of throwing this error, the code can simply take the username and password, combine them, encode them in base64, and send them in the Authorization header. This follows the standard approach and fits smoothly with how authentication is already handled.
    This PR addresses the issue #5493 Please Check and Let me know if anything is required
    Thank you.

  4. surajksharma07 commented on May 27, 2026

    @surajksharma07
    Collaborator

    @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!

  5. added a commit that references this issue on Sep 12, 2026
    f2fe475
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

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

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions