Agent Wealth HubFree public resources
中文 EN العربية

Back to catalog / Agent authorization

Connect an agent to a third-party data tool with user authorization

Pause a run when a tool needs the user’s credential, complete the external consent flow, and resume the waiting call.

Goal

Access third-party data only with scopes explicitly granted by the user, without exposing long-lived credentials to the agent.

Steps

  1. Identify resources accessed for one user and the OAuth scopes supported by the provider. [auth]
  2. Declare OAuth with AuthConfig(auth_scheme=..., raw_auth_credential=..., credential_key="documents_api") and configure a credential service for CredentialManager. [auth]
  3. When authorization interrupts the run, send the user to the provider consent screen; never put tokens in model messages. [auth]
  4. After callback, validate state and user binding, return credentials securely to the waiting tool, and limit lifetime. [auth]

How to verify

Authorization covers only requested scopes; invalid state, expired tokens, and another user’s token are rejected, with no token in logs.

Troubleshooting

If the tool requests consent again after resume, verify the callback returns the right authorization result to the same user session.

Permissions

Prerequisites

Permissions

Limitations

This procedure follows Google ADK at the pinned revision; other versions, models, or remote services may differ in APIs and event semantics. Recheck permissions, retention, and recovery before production.

Pinned upstream source

https://github.com/google/adk-python/blob/e9b74d36140f2594b24c481fb7a3825b2cb01e96/docs/guides/auth/tool_auth/index.md

Repository
google/adk-python
File path
docs/guides/auth/tool_auth/index.md
Pinned commit
e9b74d36140f2594b24c481fb7a3825b2cb01e96
Source checked
2026-10-14 · Reviewed against the pinned upstream source

Repository metrics

These values describe the upstream repository, not popularity or likes for an individual skill or playbook.

Stars
Not collected
Forks
Not collected
Observed at
Not collected

No metrics snapshot is available yet.

License: Apache-2.0

Main topic

When to use a Skill or MCP

Related resources