We want to create an agent that can fetch issues from JIRA but before calling the tool user needs to authenticate/authorize. Once the access token is received it should be refreshed with a TTL of 8hours.
We have setup integration connector but are facing issue when using OAuth. Steps followed so far-
connection_name = os.getenv("CONNECTION_NAME", "agent-connector-jira")
connection_project = os.getenv("CONNECTION_PROJECT", "")
connection_location = os.getenv("CONNECTION_LOCATION", "us-east4")
jira_oauth2_config = {
"type": "oauth2",
"flows": {
"authorizationCode": {
"authorizationUrl": "https://auth.atlassian.com/authorize",
"tokenUrl": "https://auth.atlassian.com/oauth/token",
"scopes": {
"read:jira-work": "Read Jira project and issue data",
"write:jira-work": "Create and edit Jira issues",
"read:jira-user": "Read user information",
"offline_access": "Maintain access to data"
},
}
},
}
# Convert to auth scheme
oauth_scheme = dict_to_auth_scheme(jira_oauth2_config)
# Create auth credential with your Jira OAuth app credentials
auth_credential = AuthCredential(
auth_type=AuthCredentialTypes.OAUTH2,
oauth2=OAuth2Auth(
client_id="", # From Atlassian Developer Console
client_secret="", # From Atlassian Developer Console
),
)
jira_toolset = ApplicationIntegrationToolset(
project=connection_project,
location=connection_location,
connection=connection_name,
entity_operations={"Issues": [], "Projects": []},
tool_name_prefix="jira_issue_manager",
auth_scheme=oauth_scheme,
auth_credential=auth_credential
)
root_agent = LlmAgent(
model="gemini-2.5-pro",
name="Issue_Management_Agent",
instruction="""
You are an agent that helps manage issues in a Jira.
""",
tools=[jira_toolset],
)
app = App(
name="poc_agent_connectors",
root_agent=root_agent
)
We want to create an agent that can fetch issues from JIRA but before calling the tool user needs to authenticate/authorize. Once the access token is received it should be refreshed with a TTL of 8hours.
We have setup integration connector but are facing issue when using OAuth. Steps followed so far-
Behavior observed
Questions
adk version - 1.21.0
WebUI- adk-web
OAuth provider- Atlassian with microsoft login