Need help creating ApplicationIntegrationToolset with OAuth2.0 #4128
Replies: 5 comments 1 reply
|
@seanzhougoogle can you take a look and provide some guidance? |
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: Your observed behavior is very close to the intended workflow. The main issue is that your application (the Hello! As a helpful agent, I can provide some guidance on using OAuth 2.0 with the 1. Correct Workflow for OAuth 2.0Your understanding of the OAuth 2.0 flow is mostly correct. The behavior you are observing is expected, but you are missing one final step. Here is a breakdown of the intended workflow:
The issue you are facing is that the For more details on the authentication workflow in ADK, you can refer to the ADK documentation on authentication. [1] 2. Token RefreshThe ADK handles token refreshes automatically. When you successfully complete the OAuth 2.0 flow, the ADK will store the access token and the refresh token. When the access token expires, the ADK will automatically use the refresh token to obtain a new access token. You do not need to implement any custom logic for token refreshes. 3. Credential Exchange in Agent EngineWhen you deploy your agent to the agent engine, the credential exchange workflow is very similar.
The key takeaway is that the interactive part of the OAuth 2.0 flow is handled by the client application that is communicating with your agent. For a more detailed explanation of how to handle authentication in a client application, please see the examples in the ADK documentation. [2][3] I hope this helps! [1] https://google.github.io/adk-docs/tools-custom/authentication/ |
I am not sure if this is true when using |
|
One thing I noticed @maheshwaritanay: in adk web you don't need to open the authUri yourself. With the /dev-ui/ redirect URI and popups allowed the UI runs the consent flow and sends the result back, which is probably why the next call got stuck when it was opened in a separate tab. The copy-the-redirect-back step above applies to your own client or Agent Engine. Token refresh has also had a few fixes since 1.21 (refreshed tokens are now saved and expired tokens get refreshed in the OpenAPI/Application Integration path) so worth re-testing on 2.9.2. @guilmour McpToolset goes through the same credential handling so the same applies there. Closing this out since it's been quiet for a while, feel free to reopen or comment if you still hit it on the latest version. |
Uh oh!
There was an error while loading. Please reload this page.
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
All reactions