Skip to content

CLI login fails with 403 when browser session is under an organization account #1203

@filakovsky

Description

@filakovsky

When a user is logged into Apify Console under an organization account in the browser, running apify login in the terminal and selecting a personal account fails with a 403 error.

Steps to reproduce:

  1. Log into Apify Console in the browser under an organization account.
  2. Run apify login in the terminal.
  3. Select personal account as the login target.

Expected behavior:

Login succeeds under the selected personal account.

Actual behavior:

The CLI fails with:

Failed to handle request 'POST - /api-keys'
{
  "response": {
    "status": "error",
    "statusCode": 403,
    "errorCode": "insufficient-permissions",
    "errorMessage": "Insufficient permissions for users. Make sure you're passing a correct API token and that it has the required permissions."
  },
  "request": {
    "url": "https://console-backend.apify.com/api-keys",
    "method": "post",
    ...
  }
}

Notes:

The inverse works fine: when the browser session is under a personal account, the CLI can log in to any target (personal or organization) without issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-dxIssues owned by the DX team.

    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