manifest icon indicating copy to clipboard operation
manifest copied to clipboard

Add "Renew Auth Token" / re-authenticate action for existing OAuth provider accounts

Open xtraxion opened this issue 6 months ago • 5 comments

Feature request

Please add a "Renew Auth Token" / "Re-authenticate" action for existing OAuth-based provider accounts, especially OpenAI/Codex subscription auth.

Problem

OpenAI/Codex OAuth authentication appears to expire after a limited time, e.g. around 30 days.

Currently, when the auth expires, there does not seem to be a way to renew the login for an existing provider account. The workaround is to delete the provider account completely and then add it again.

That has a few downsides:

  • existing routing settings can be lost or need to be recreated
  • agent-specific provider/account selection needs to be configured again
  • the process is error-prone when multiple agents use similar provider setups
  • it feels like credential rotation, but behaves like deleting and recreating infrastructure

Desired behavior

For an existing OAuth provider account, Manifest should offer a button such as:

  • "Renew Auth Token"
  • "Re-authenticate"
  • "Refresh login"

This should start the same OAuth/login flow again, but update the existing provider account instead of creating a new one or requiring deletion first.

Expected UX

Example flow:

  1. User opens an existing OpenAI/Codex OAuth provider account
  2. User clicks "Renew Auth Token"
  3. Manifest opens the OAuth/device/login flow again
  4. On success, Manifest updates the stored auth credentials for the existing provider account
  5. Existing routing, account label, default status, and agent references stay intact

Why this matters

OAuth/subscription auth is not a one-time setup if tokens expire periodically. Users should be able to rotate or refresh credentials without breaking their existing routing setup.

Related

This would complement a central/shared provider credential vault, because shared OAuth credentials would still need a safe renewal flow.

xtraxion avatar May 23 '26 23:05 xtraxion

hi @xtraxion, Manifest does already handle OAuth automatic token refresh. It didn't work for you ? What's the error you had ?

guillaumegay13 avatar May 25 '26 08:05 guillaumegay13

Thanks for the clarification. I think this may be a different case than the normal automatic access-token refresh.

For one of my OpenAI/Codex accounts, Manifest suddenly logged this error:

{
  "error": {
    "message": "Your authentication token has been invalidated. Please try signing in again.",
    "type": "invalid_request_error",
    "code": "token_invalidated",
    "param": null
  },
  "status": 401
}

So it looks like the token/session was invalidated and automatic refresh could no longer recover it.

In that situation I could not find a way in the UI to re-run the OAuth login for the existing provider account. The only workaround I found was deleting the provider account and adding it again, which also means redoing account/routing setup.

If there is already a way to trigger re-authentication for an existing OAuth provider account, where can I find it in the UI?

xtraxion avatar May 25 '26 18:05 xtraxion

thanks for the clarification! indeed there's no way yet - I'll check

guillaumegay13 avatar May 25 '26 18:05 guillaumegay13

Hi @xtraxion and @guillaumegay13,

I am experiencing the same core issue described here, specifically with OpenAI/Codex (GPT-5.3/5.4) via the Manifest Playground in a self-hosted Docker setup.

My Setup:

  • Manifest Version: manifestdotbuild/manifest:latest (running in OrbStack Docker on macOS)
  • Access: Via http://127.0.0.1:2099 (standard self-hosted setup)
  • Hermes Agent Integration: Hermes uses Manifest as an auto model router, authenticating with a mnfst_ API key. This API path works reliably, routing to gpt-5.3-codex and other models as expected.

The Problem: When attempting to use OpenAI/Codex models (e.g., GPT-5.3-Codex, GPT-5.4) within the Manifest Playground UI, I consistently receive the error: {"detail":"Could not parse your authentication token. Please try signing in again."}

Key Observations:

  1. Direct API calls through Manifest work: My Hermes agent (using a mnfst_ API key) can successfully route requests to gpt-5.3-codex via Manifest's /v1/chat/completions endpoint. This confirms Manifest is correctly configured to reach the OpenAI backend with valid credentials for API-key-based access.
  2. Playground fails consistently: The Playground UI, however, consistently fails for these OpenAI/Codex models.
  3. "Never worked, even with clean install": This issue has persisted even after a complete clean re-installation of the Manifest Docker stack (including clearing all data). This suggests it's not a simple case of a stale token, but potentially a more fundamental issue with how the Playground UI's session/context handles OpenAI OAuth tokens for self-hosted deployments.
  4. Correlation with Issue #1962: This consistent failure from a fresh install strongly suggests a connection to #1962: "OAuthDetailView: 'Add another key' shows no paste-input fallback for multi-key OpenAI Codex OAuth". If the initial OAuth flow itself is broken/unreliable in the self-hosted UI, the token might never be correctly established or refreshed for the Playground's context.

Impact: The Playground, intended for interactive testing and exploration, is unusable for OpenAI/Codex models in my self-hosted environment, forcing all testing through the API endpoint.

This seems to be a clear manifestation of the problem described in #2012, compounded by the potential issues with OAuth flow reliability in self-hosted setups as per #1962.

I hope this additional context from a self-hosted user helps in diagnosing. Thank you for your work on Manifest!

jagaliano avatar May 30 '26 18:05 jagaliano

hey @xtraxion @jagaliano - update + procedure on this 👇

shipped a fix in #2113 for the root cause. quick rundown:

what was happening: OpenAI rotates the refresh token on every refresh now. Manifest could fire two refreshes at the same time (parallel requests hitting an expired token) - the second one reused the already-rotated refresh token, OpenAI's reuse-detection kicked in and invalidated the whole token family. that's the token_invalidated / refresh_token_invalidated 401 you saw. once OpenAI does that, the grant is dead on their side.

what #2113 changes: refreshes are now coordinated per account - only one runs at a time, it re-reads the freshest token from the db before refreshing, and persists the rotated token with retries. so a healthy account won't get bricked by Manifest anymore.

procedure if you're stuck right now: the fix prevents it going forward but it can't un-revoke a token OpenAI already killed. so for any account currently showing token_invalidated, you need to reconnect it once (disconnect + reconnect / re-auth). after that the fix keeps it alive.

thank you!

guillaumegay13 avatar Jun 04 '26 09:06 guillaumegay13