docker-drawio icon indicating copy to clipboard operation
docker-drawio copied to clipboard

Viewer prompts for authorization using a diagram published using a public Google Drive URL

Open faelnor opened this issue 7 months ago • 2 comments

I have set up DRAWIO_LIGHTBOX_URL and DRAWIO_BASE_URL on two different subdomains pointing to the same docker container, and a public Google Document that I would like to view in my self-hosted instance.

I have set up configuration variables for the Drive Client and App IDs for the main app as well as separate ones for the viewer app.

Version is 29.6.10 pulled from jgraph/drawio:latest on 2026-04-14.

If I Publish the diagram, I get the following URL which looks correct: https://<my-instance>/?lightbox=1&highlight=0000ff&nav=1&title=Sharetest.drawio&dark=auto#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D13Ez_tFVogQLR91fHWeaOjO298fTMKY1Z%26export%3Ddownload

However, whenever I try to view the file I get a prompt for Google Drive authorization. If I try to open exactly the same URL in viewer.diagrams.net (link), the file opens successfully. What am I missing?

faelnor avatar Apr 13 '26 16:04 faelnor

👋 Thank you for opening this issue!


Summary: The user is self-hosting draw.io via Docker and trying to view a publicly shared Google Drive diagram using the lightbox/viewer URL, but the self-hosted instance prompts for Google Drive authorization while the same URL works on the official viewer.diagrams.net. This is likely because the self-hosted instance does not have Google API/OAuth credentials configured.


📝 Additional Information Needed

To help us investigate this more effectively, could you please provide:

  • Docker image/version: Which Docker image is being used for the self-hosted instance (e.g., jgraph/drawio) and what version/tag?
  • Google Drive API configuration: Has a Google Drive API key / OAuth client ID been configured for the self-hosted instance? The official viewer.diagrams.net has its own API credentials that allow it to fetch public Google Drive files. A self-hosted instance would need its own Google API credentials configured.
  • Environment variables / configuration: What environment variables are set on the Docker container beyond DRAWIO_LIGHTBOX_URL and DRAWIO_BASE_URL? Specifically, any Google-related configuration such as DRAWIO_GOOGLE_CLIENT_ID, DRAWIO_GOOGLE_APP_ID, or DRAWIO_GOOGLE_VIEWER_CLIENT_ID.

We also have some questions:

  • Have you configured Google API/OAuth credentials (client ID, API key) for your self-hosted draw.io instance? The reason it works on viewer.diagrams.net but not your instance is almost certainly that the official instance has Google API credentials configured, allowing it to fetch public Google Drive files without user authorization. Your self-hosted instance likely lacks these credentials, so it falls back to prompting the user for OAuth authorization.
  • Have you set up a Google Cloud project with the Drive API enabled and created OAuth 2.0 credentials scoped to your self-hosted domain? You would need to configure the resulting client ID in your draw.io deployment (e.g., via DRAWIO_GOOGLE_CLIENT_ID or the equivalent configuration).
  • As a potential workaround: have you tried using a direct download URL for the file instead of the Google Drive URL? For example, you could host the .drawio file on a simple HTTP server or use a CORS-friendly URL that doesn't require Google API credentials to access.


🤖 This is an automated response to help with initial triage. A human maintainer will review this issue. If you've provided all the requested information, no further action is needed - we'll get back to you soon!

draw-io-triage-bot avatar Apr 13 '26 16:04 draw-io-triage-bot

I have set up configuration variables for the Drive Client ID for the main app and separate ones for the viewer app. Each client ID has its own client secret under a single Google Cloud project (unique APP_ID). The authorized domains for each client ID are scoped against the app and viewer subdomains respectively.

Edit: Corrected "API Key" to "Client ID". I actually do not have an API key. I can create one but I do not know how to configure it in draw.io as I have found no relevant doc.

Regarding the workaround, I could do that but I'd like to avoid custom scripts fetching from GDrive for now, still hoping I can get it working exactly as per viewer.diagrams.net :)

faelnor avatar Apr 13 '26 16:04 faelnor

The viewer loads the file through this image's /proxy endpoint and falls back to the Google Drive authorization prompt when that fails. /proxy is disabled unless you set ENABLE_DRAWIO_PROXY=1; that works on 29.6.10, but on current images the endpoint fails for HTTPS URLs.

We're replacing the Java back-end with our Node back-end, so we won't be fixing issues in the Java servlets. Closing on that basis.

davidjgraph avatar Sep 29 '26 11:09 davidjgraph