# Codex login/Sign-in could not be completed Token exchange failed:

**URL:** https://community.openai.com/t/codex-login-sign-in-could-not-be-completed-token-exchange-failed/1376953
**Category:** Codex CLI
**Tags:** account
**Created:** [March 17, 2026, 6:15am UTC](https://community.openai.com/t/codex-login-sign-in-could-not-be-completed-token-exchange-failed/1376953 "2026-03-17T06:15:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![deec2d258e05e00ed06d](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/deec2d258e05e00ed06d/32/730781_2.png) [@deec2d258e05e00ed06d](https://community.openai.com/u/deec2d258e05e00ed06d)
#### Post date: [March 17, 2026, 6:15am UTC](https://community.openai.com/t/codex-login-sign-in-could-not-be-completed-token-exchange-failed/1376953/1 "2026-03-17T06:15:15Z")

</div>

I can can not codex cli. Although I have plus account. Shows this error everytime I try to signin with chatgpt account.

Token exchange failed: error sending request for url (`https://auth.openai.com/oauth/token`)

**Error code** `token_exchange_failed`

**Details** `Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token)`

Return to Codex to retry, switch accounts, or contact your workspace admin if access is restricted.

---

<div class="post-metadata">

### Author: ![\_Marvin](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/_marvin/32/511303_2.png) [@\_Marvin](https://community.openai.com/u/_Marvin)
#### Post date: [March 18, 2026, 6:41pm UTC](https://community.openai.com/t/codex-login-sign-in-could-not-be-completed-token-exchange-failed/1376953/2 "2026-03-18T18:41:45Z")

</div>

Here is the solution.  
Vscode extension may have some issues with login in browser sometimes. you can instead install nodejs with npm if not installed.

- Install codex with `npm i -g @openai/codex`.
- Write in terminal `codex login`.
- Copy that link shown in terminal into browser if it doesnt redirect.
- Login.
- Restart VScode and it should be working.
