You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR — The auth layer holds one account and cannot tell where a token came from. Three resolvers disagree about which token wins, auth.json is a flat blob for a single user, and the keyring uses one fixed name per secret. This stage rewrites all three so the storage can hold N accounts. Nothing changes for users — no new flags, no new commands. Three subtasks, each releasable on its own.
Part of #1297. Comes after Stage-0 (#1387), and everything later depends on it.
Secret storage v2 — per-profile keys in the keyring and the file backend
Order is fixed. 2 needs 1's read/write split; 3 needs the user IDs from 2.
Decisions already made
Precedence is --token → APIFY_TOKEN → stored. It is what mcp install and the actor entrypoint already do; only resolveToken differs.
APIFY_TOKEN keeps working. Removing it would break CI, agent harnesses and every Actor run.
apify login ignores APIFY_TOKEN. Logging in is explicit.
Only apify login writes credentials. --token and APIFY_TOKEN are one-off.
Profiles are keyed by userId, not by a display name, so a rename cannot orphan a secret.
The XDG config directory move is not part of this. Nobody outside Apify has asked, and two migrations in one release is how you get a bug nobody can reproduce.
Not in scope
No additive login, no --profile, no auth switch, no auth list. The file can hold N profiles; only Stage-2 (#1386) puts a second one there. Users see no difference after this stage.
Compatibility
After #1419 an older CLI reads the new file, finds no token, and reports that you are logged out. Needs a changelog note. The auth.json.v1.bak written by the migration is the manual way back.
Note
TL;DR — The auth layer holds one account and cannot tell where a token came from. Three resolvers disagree about which token wins,
auth.jsonis a flat blob for a single user, and the keyring uses one fixed name per secret. This stage rewrites all three so the storage can hold N accounts. Nothing changes for users — no new flags, no new commands. Three subtasks, each releasable on its own.Part of #1297. Comes after Stage-0 (#1387), and everything later depends on it.
Subtasks
loginpersistsauth.jsonv2 — profiles keyed by user ID, with migrationOrder is fixed. 2 needs 1's read/write split; 3 needs the user IDs from 2.
Decisions already made
--token→APIFY_TOKEN→ stored. It is whatmcp installand theactorentrypoint already do; onlyresolveTokendiffers.APIFY_TOKENkeeps working. Removing it would break CI, agent harnesses and every Actor run.apify loginignoresAPIFY_TOKEN. Logging in is explicit.apify loginwrites credentials.--tokenandAPIFY_TOKENare one-off.userId, not by a display name, so a rename cannot orphan a secret.Not in scope
No additive login, no
--profile, noauth switch, noauth list. The file can hold N profiles; only Stage-2 (#1386) puts a second one there. Users see no difference after this stage.Compatibility
After #1419 an older CLI reads the new file, finds no token, and reports that you are logged out. Needs a changelog note. The
auth.json.v1.bakwritten by the migration is the manual way back.🤖 Generated with Claude Code