Skip to content

cntb CLI: 401 Unauthorized for accounts on new.contabo.com portal #54

@thanhbn

Description

@thanhbn

The cntb CLI fails to authenticate for accounts registered on the new.contabo.com portal. The same credentials work correctly when logging into new.contabo.com via browser.

Steps to Reproduce

  1. Have an account on new.contabo.com (new customer portal)
  2. Generate API credentials (OAuth2 Client ID & Secret) from
    new.contabo.com
  3. Configure cntb CLI:
    cntb config set-credentials --oauth2-clientid=
    --oauth2-client-secret= --oauth2-user=
    --oauth2-password=
  4. Run any command, e.g. cntb get instances

Expected Behavior

CLI authenticates successfully and returns instance list.

Actual Behavior

FATAL Could not get access token due to an error: oauth2: cannot fetch
token: 401 Unauthorized
Response: {"error":"invalid_grant","error_description":"Invalid user
credentials"}

Notes

  • The same email/password works fine on new.contabo.com web login
  • These credentials do not work on my.contabo.com (legacy
    portal), which suggests the CLI only authenticates against the legacy auth endpoint
  • It appears the CLI's OAuth2 token endpoint may not support the new portal's authentication system
  • other issues:
    • password validation on my.contabo.com & new.contabo.com are inconsistent.
    • user register on new.contabo.com can't login on my.contabo.com

Environment

  • OS: Linux (WSL2)
  • cntb version: v1.5.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions