Skip to content

Support OAuth / Gemini CLI Authentication for Enterprise Users #38

@Antifrajz

Description

@Antifrajz

Hi Nano Banana maintainers,

I’m trying to use the Nano Banana extension in an enterprise environment with Gemini CLI. Currently, Nano Banana requires a GEMINI_API_KEY (or NANOBANANA_GEMINI_API_KEY) for authentication, which I cannot obtain because our organization uses Google Workspace / Enterprise and Gemini CLI authenticates via OAuth (Application Default Credentials).

It would be great if Nano Banana could support OAuth / ADC authentication in addition to the existing API key method. The desired behavior would be:

  1. If a GEMINI_API_KEY environment variable is set, continue using it (no changes for non-enterprise users).
  2. If no API key is set, automatically fetch an OAuth token using Google Application Default Credentials, the same way Gemini CLI does.
  3. Use the required Gemini API scope: https://www.googleapis.com/auth/generative-language.
  4. Work transparently for enterprise users who are already logged in via gcloud auth login or gcloud auth application-default login.

This would enable enterprise users to use Nano Banana with Gemini CLI without requiring API keys, maintaining full compatibility with the current extension behavior for other users.

Thank you for considering this feature request!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions