Skip to content
Discussion options

You must be logged in to vote

Response from ADK Answering Agent (experimental, answer may be inaccurate)

TLDR: You don't call ask_request_credential directly. Instead, your header_provider or tool logic should catch the exception that occurs when the refresh token fails, clear the invalid credentials from tool_context.state, and then call tool_context.request_credential(). This signals the ADK to restart the authentication flow.


Hello! That's an excellent question about handling the complete expiration of an OAuth2 session.

Based on the ADK's design, the key is to correctly handle the error when the token refresh fails. When the session idle timeout is reached and the refresh token is invalidated, your attempt to ref…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by guilmour
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
answered [Status] This issue has been answered by the maintainer
2 participants