adk-web icon indicating copy to clipboard operation
adk-web copied to clipboard

Set `user` when deploying a webUI

Open dylan-apex opened this issue 4 months ago • 1 comments

Currently whenever you deploy using either the $adk commands or using the get_fast_api_app, all users who test the application are all labeled as 'user' in the Session/Memory instances (with I believe the exception of deployments via Agent Engine).

I would love to see support for being able to set the current user. I've brainstormed a few ways this could be implemented using the FastAPI App:

  • Implement a get_user function input to get_fast_api_app()
    • Would be the simplest way - every time a new session is created or retrieved, this function would be called to get the current user.
    • Allows for a wide variety of integrations depending on deployment scenarios
  • Implement a callback url that sets the user in the browser session
    • If I deploy this and put an OAuth screen in front of this, let me have the callback url go to /api/user-callback with a payload and it will set and use the user_id returned in the payload
  • Integrate with Google Cloud IAP
    • https://cloud.google.com/iap/docs/identity-howto
    • Cloud Run IAP is in preview, but GKE IAP is not.
    • Would be simple to check and would encourage people to deploy on GCP if authentication is simple

Context

Lastly, it would be nice if there was an easy way to set the user for a session. We're currently using IAP with a Cloud Run deployment. I'm thinking if we could pass a get_user function to the get_fast_api_app that could return the current user, then we can provide a way for the app to look up the current user ourselves. This would make it easier for many different deployment types to have a way to separate users.

@dylan-apex great feedback. Do you mind creating a issue for us to track? Thanks.

Originally posted by @hangfei in #2133

dylan-apex avatar Jul 31 '25 17:07 dylan-apex

@wyf7107 @DeanChensj Could you help review if this is something we should add, and if the community can contribute?

hangfei avatar Aug 01 '25 21:08 hangfei