-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Description
Description
The Railway CLI fails to authenticate using a valid API token created from the Account Settings page. Both railway login and token-based authentication methods are not working.
Environment
- OS: Linux 6.17.0-6-generic (Ubuntu-based)
- Railway CLI versions tested:
- 4.11.0 (binary from
/usr/local/bin) - 4.11.1 (npm global install)
- 4.11.0 (binary from
- Node.js: v20.19.4
- npm: 9.2.0
Steps to Reproduce
- Created a new API token from https://railway.app/account/tokens
- Attempted authentication using multiple methods:
Method 1: Browser login
$ railway login
> Open the browser? Yes
Unauthorized. Please login with `railway login`Method 2: Browserless login
$ railway login --browserless
Browserless Login
Please visit: [URL]
Your pairing code is: salmon-enchanting-exploration
Unauthorized. Please login with `railway login`Method 3: Token authentication
$ export RAILWAY_TOKEN="[valid-token-from-account-settings]"
$ railway whoami
Unauthorized. Please login with `railway login`
Note: Using RAILWAY_TOKEN environment variableAdditional Testing
Tested the token directly against the API:
$ curl -H "Authorization: Bearer [token]" \
https://backboard.railway.app/graphql/v2 \
-d '{"query":"query { me { id email } }"}' \
-H "Content-Type: application/json"
Response: {"errors":[{"message":"Not Authorized"...}]}What I've Tried
- ✅ Cleared all Railway config directories (
~/.config/railway/,~/.railway/) - ✅ Reinstalled Railway CLI via npm
- ✅ Created multiple new tokens from Account Settings
- ✅ Tested with both binary and npm versions
- ✅ Verified network connectivity to Railway API
- ✅ Tested different authentication header formats
Expected Behavior
The CLI should successfully authenticate using a valid API token created from the Account Settings page.
Actual Behavior
All authentication methods fail with "Unauthorized" error, even with freshly created valid tokens.
Additional Context
- I have an active paid Railway account
- The same tokens work when logging into the Railway web dashboard
- There appears to be a conflict between the binary installation and npm installation on the system
Any guidance on resolving this issue would be greatly appreciated.
elina-israyelyan and yorchv
Metadata
Metadata
Assignees
Labels
No labels