google / google/adk-python

BaseAuthenticatedTool saves invalid credentials

未关闭
#3,016 1 条评论 0 个 reaction 已指派 3 人 已被 @klateefa 认领 在 GitHub 查看
needs review tools
主要语言
Python
星标
21.5k
派生
4k
平均合并
1 天 22 小时
30 天内合并 PR
31

描述

**Is your feature request related to a problem? Please describe.**
The BaseAuthenticatedTool `run_async` implementation obtains credentials from the tool context using the credential manager, which saves the credential for the session, before calling the tool implementation. This means that no future uses of the tool will ask for authentication, even if the user accidentally provided invalid credentials (such as an invalid username/password combo, or a token for a user account instead of an admin account).

This is problematic for automatic tool implementations like MCPTool and OpenAPITool. While a custom tool can remove the credentials from context if necessary (see https://google.github.io/adk-docs/tools/authentication/#authentication-logic-within-the-tool-function), these implementations don't allow a user to re-authenticate on failure.

**Describe the solution you'd like**
Some mechanism for removing credentials from the context when a tool responds with an unauthorized or forbidden error.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。