[FEATURE] Multi-account session management
@HasanAboShally đang làm issue này rồi.
Từ ngày 12/4/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Problem
Consultants and developers who work across multiple Microsoft Fabric tenants and client environments face a painful workflow today: every time they need to switch context, they must run fab auth logout followed by a full fab auth login, re-authenticating interactively each time.
Real-world use case
A typical consulting scenario:
- Client A - Production tenant
tenant-aaa, user[email protected] - Client B - Dev/test tenant
tenant-bbb, user[email protected] - Internal - Corporate tenant
tenant-ccc, user[email protected]
Switching between these today requires a full logout/login cycle for each transition, which is disruptive, slow, and breaks automation scripts that assume a persistent session.
Proposed solution
Add stored user session management to the CLI so that multiple interactive authentication sessions can coexist and be switched instantly:
| Command | Description |
|---|---|
fab auth list |
List all stored user sessions with active/valid status |
fab auth switch |
Switch to another stored session (interactive or direct) |
fab auth switch -u <account> -t <tenant> |
Switch directly to a specific account (case-insensitive) |
fab auth logout -u <account> |
Log out a specific session without affecting others |
fab auth logout --all |
Clear all stored sessions |
Behavior
- Two stored sessions, no flags:
fab auth switchautomatically toggles to the other account. - Three or more sessions, no flags: an interactive prompt is shown.
- With
-u(and optionally-t): switches directly, no prompt. - Sessions are validated against the MSAL token cache and marked as valid/invalid in
fab auth list. - Environment variable authentication (
FAB_TOKEN, etc.) takes precedence and blocks session switching with a clear error message. - Interactive login now preserves the broker-backed MSAL app across the Fabric, OneLake, and Azure token warm-up so newly selected accounts are stored cleanly on Windows.
Acceptance criteria
-
fab auth listshows all stored sessions with active/valid/last_used metadata -
fab auth switchsupports direct (-u,-t) and interactive selection -
fab auth logoutsupports per-session removal (-u,-t) and bulk (--all) - Username matching is case-insensitive
- Session switching is blocked when env var auth is active
- Documentation and examples are up to date
- Tests cover happy paths and edge cases
- Ngôn ngữ chính
- Python
- Star
- 173
- Fork
- 63
- Merge trung bình
- 3 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/fabric-cli
-
ai:bug-triage:unable-to-process bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoft/fabric-cli#287 · 2 bình luận ·
-
ai:feature-triage:unable-to-process enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
microsoft/fabric-cli#292 · 1 bình luận ·
-
ai:question-triage:unable-to-process question
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
microsoft/fabric-cli#288 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
microsoft/fabric-cli#286 · 3 bình luận ·
-
ai:feature-triage:unable-to-process enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
microsoft/fabric-cli#279 · 1 bình luận ·
Tất cả issue của microsoft/fabric-cli
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
letsencrypt/cp-cps#353 ·
-
Marble Madness II is missingĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
PedestrianDynamics/pyFDS-Evac#394 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
DOI-USGS/pywatershed#421 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
python-pillow/Pillow#10087 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày