{"record":{"id":"d3c4cd09e5453cd0","repo":"openai/codex","slug":"permissiondenied-d3c4cd","errorCode":"PermissionDenied","errorMessage":"Login is restricted to workspace id(s) {}.","messagePattern":"Login is restricted to workspace id\\(s\\) (.+?)\\.","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/login/src/auth/manager.rs","lineNumber":1040,"sourceCode":"                personal_access_token: None,\n                bedrock_api_key: None,\n            }\n        }\n    };\n    save_auth(\n        codex_home,\n        &auth_dot_json,\n        auth_credentials_store_mode,\n        keyring_backend_kind,\n    )\n}\n\nfn ensure_auth_workspace_allowed(\n    expected_workspace_ids: Option<&[String]>,\n    account_id: &str,\n) -> std::io::Result<()> {\n    crate::server::ensure_workspace_account_allowed(expected_workspace_ids, account_id)\n        .map_err(|message| std::io::Error::new(std::io::ErrorKind::PermissionDenied, message))\n}\n\nfn ensure_agent_identity_workspace_allowed(\n    expected_workspace_ids: Option<&[String]>,\n    agent_identity: &AgentIdentityStorage,\n) -> std::io::Result<()> {\n    let Some(expected_workspace_ids) = expected_workspace_ids else {\n        return Ok(());\n    };\n\n    match agent_identity {\n        AgentIdentityStorage::Jwt(jwt) => {\n            let record = AgentIdentityAuthRecord::from_agent_identity_jwt(jwt)?;\n            ensure_auth_workspace_allowed(Some(expected_workspace_ids), &record.account_id)\n        }\n        AgentIdentityStorage::Record(record) => {\n            ensure_auth_workspace_allowed(Some(expected_workspace_ids), &record.account_id)\n        }","sourceCodeStart":1022,"sourceCodeEnd":1058,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/login/src/auth/manager.rs#L1022-L1058","documentation":"Error \"Login is restricted to workspace id(s) {}.\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/login/src/auth/manager.rs:1040 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}