-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Hi team,
I am trying to use the HubSpot connector with authentication override enabled in the Google Cloud Integration Connectors. My goal is to allow multiple users to use the application, each with different OAuth credentials.
Here’s my setup:
Connector Setup:
HubSpot connector active
OAuth enabled in the connector
Auth Override enabled in the connector settings
Current Code:
from google.adk.tools.application_integration_tool.application_integration_toolset import ApplicationIntegrationToolset
from google.adk.tools.openapi_tool.auth.auth_helpers import dict_to_auth_scheme
from google.adk.auth import AuthCredential, AuthCredentialTypes, OAuth2Auth
oauth2_data = {
"type": "oauth2",
"flows": {
"authorizationCode": {
"authorizationUrl": "https://app.hubspot.com/oauth/authorize",
"tokenUrl": "https://api.hubapi.com/oauth/v1/token",
"scopes": {
"crm.objects.contacts.read": "Read contacts",
"crm.objects.deals.read": "Read deals"
}
}
}
}
oauth_scheme = dict_to_auth_scheme(oauth2_data)
auth_credential = AuthCredential(
auth_type=AuthCredentialTypes.OAUTH2,
oauth2=OAuth2Auth(
client_id="501a176a-9289-4a12-8344-8c1acf3f0a3a",
client_secret="8d21074a-932f-4317-a369-e4b5bd28214e"
)
)
connector_tool = ApplicationIntegrationToolset(
project="gemini-xmcp",
location="us-central1",
connection="hubspot-gemini",
entity_operations={
"Contacts": ["LIST", "GET"],
"Deals": ["LIST", "GET"]
},
actions=[],
tool_name_prefix="hubspot_tool",
tool_instructions="Use this tool to interact with HubSpot Contacts and Deals",
auth_scheme=oauth_scheme,
auth_credential=auth_credential
)
Agent Setup:
from google.adk.agents.llm_agent import LlmAgent
from .tools import connector_tool
root_agent = LlmAgent(
model="gemini-2.0-flash-exp",
name="connector_agent",
instruction="Help user, leverage the tools you have access to",
tools=[connector_tool]
)
Problem:
After enabling Auth Override in the connector, I am receiving the following error when running the ADK web server:
"Auth Override is enabled for this connection but no dynamic auth config is provided."
It seems the ApplicationIntegrationToolset is not receiving the dynamic authentication information, even though I’ve passed auth_scheme and auth_credential.
Questions:
Am I missing a step in providing dynamic OAuth credentials per user?
Should I be passing a dynamicAuthConfig variable somewhere in the code?
Is there a reference example for using authentication override with HubSpot connectors in ADK?
Any guidance or examples would be very helpful, I want to allow multiple users to authenticate dynamically without modifying the connector manually for each user.
Thank you!