Description:
When using gog auth add --manual on a remote server (accessed via SSH), the OAuth authorization flow is challenging because:
- Each invocation generates a new
state parameter
- Authorization codes expire quickly (within minutes)
- If the redirect URL isn't pasted immediately, the state mismatch occurs
- There's no way to reuse an authorization code with its original state
Current Behavior:
ssh remote-server "gog auth add user@example.com --services gmail --manual"
# Outputs authorization URL with state=ABC123
# User authorizes in browser, gets redirect with state=ABC123&code=XYZ
# But if this takes too long or the command is re-run, state changes
# Result: "state mismatch" error
Suggested Improvements:
-
Persist state parameter: Save the state to a temp file so it can be reused if the command is re-run within a short time window
-
Accept authorization code directly: Add a flag like --auth-code to bypass the state check:
gog auth add user@example.com --auth-code "4/0ASc3..."
-
Longer timeout: Increase the wait time for manual paste, or add a flag for custom timeout
-
SSH-friendly mode: Add a flag like --remote that:
- Generates the auth URL
- Saves state persistently
- Allows paste from a separate command invocation
- Example:
gog auth add user@example.com --remote --step 1 # outputs URL, saves state
# User authorizes...
gog auth add user@example.com --remote --step 2 --url "http://localhost:1/..."
Use Case:
This is particularly important for:
- Automated deployments
- Server environments where interactive SSH is difficult
- CI/CD pipelines
- Remote server management through SSH proxies
Workaround:
Currently requires an interactive SSH session with -t flag and quick copy-paste of the redirect URL.
Environment:
- gog version: v0.9.0
- OS: Ubuntu Linux (remote server)
- Access method: SSH
Would love to see this improved for remote server deployments!
Description:
When using
gog auth add --manualon a remote server (accessed via SSH), the OAuth authorization flow is challenging because:stateparameterCurrent Behavior:
Suggested Improvements:
Persist state parameter: Save the state to a temp file so it can be reused if the command is re-run within a short time window
Accept authorization code directly: Add a flag like
--auth-codeto bypass the state check:gog auth add user@example.com --auth-code "4/0ASc3..."Longer timeout: Increase the wait time for manual paste, or add a flag for custom timeout
SSH-friendly mode: Add a flag like
--remotethat:Use Case:
This is particularly important for:
Workaround:
Currently requires an interactive SSH session with
-tflag and quick copy-paste of the redirect URL.Environment:
Would love to see this improved for remote server deployments!