Skip to content

auth login fails with valid token since v0.8.0 #175

@orloffv

Description

@orloffv

Description

teamcity auth login fails with "Authentication failed: invalid or expired token" even though the token is valid. The same token works correctly with v0.7.2 and via direct curl calls to the API.

Steps to reproduce

  1. Install teamcity CLI v0.8.2 (also reproduces on v0.8.0 and v0.8.1)
  2. Generate a valid API token on TeamCity server
  3. Run teamcity auth login -s https://<server> -t <token> --verbose

Observed behavior

Validating... [debug] > GET https://<server>/app/rest/users/current
[debug] > Accept: application/json
[debug] > Authorization: [REDACTED]
✗
Error: Authentication failed: invalid or expired token

The CLI reports the token as invalid and exits with code 1.

Expected behavior

Login should succeed — the token is valid.

Verification

The same token works fine with:

  • v0.7.2: teamcity auth login succeeds, prints ✓ Logged in as <user>
  • curl: curl -H "Authorization: Bearer <token>" https://<server>/app/rest/users/current returns HTTP 200 with valid user JSON

Verbose output from v0.7.2 with the same token and server shows the same GET /app/rest/users/current request returning HTTP 200, but v0.7.2 correctly parses the response while v0.8.x does not.

Environment

  • OS: macOS (Apple Silicon)
  • TeamCity server version: 2025.07
  • CLI installed via: brew install jetbrains/utils/teamcity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions