Skip to content

[FEATURE] allow login via refresh token #125

Description

@mostafa-binesh

Feature Description
Add an optional auth method that allows users to log in by pasting a valid ChatGPT refresh token instead of completing the browser OAuth flow.

Use Case
This would help in cases where the normal browser login flow is inconvenient or unreliable, such as:

  • remote SSH/devbox workflows
  • headless environments like WSL or containers
  • systems where the local callback server or browser handoff fails
  • users who already have a valid refresh token and just need a bootstrap path

The plugin already supports refreshing credentials from a refresh token, but it cannot currently initialize auth from one directly.

Proposed Implementation
Add a new auth method that accepts a refresh token, calls the existing refresh-token exchange logic to obtain access, refresh, and expires, then stores the normal OAuth auth object and continues with the existing flow unchanged.

This would only use the refresh token against the OAuth token endpoint, not the Codex backend.

Compliance Consideration
Please confirm:

  • This feature is for personal development use
  • This feature is not intended for commercial resale or multi-user access
  • Final compliance with OpenAI's Terms of Service should be confirmed by the maintainer

Alternatives Considered
The current workaround is using the browser OAuth flow, but that is less convenient in headless or remote setups.

Additional Context
If this approach sounds acceptable, I can implement it and open a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions