Skip to content

OP2-81: Support personal Microsoft accounts (outlook.com, hotmail, live) - #17

Merged
BrewingCoder merged 2 commits into
mainfrom
op2-81-personal-microsoft-accounts
Nov 5, 2026
Merged

BrewingCoder merged 2 commits into
mainfrom
op2-81-personal-microsoft-accounts

Conversation

@BrewingCoder

Copy link
Copy Markdown
Owner

Implements YouTrack OP2-81: let users connect personal Microsoft accounts (outlook.com, hotmail.com, live.com), not just work or school accounts.

Approach

Personal accounts get a separate sign-in path through /consumers. The user picks the kind of account up front in the add-connection dialog. Work sign-ins stay on /organizations. Switching to /common would have brought back the picker where a work account and a personal account with the same address look identical, which is how a past connection ended up on the wrong mailbox.

  • New setting EntraOptions.PersonalAccounts (ENTRA_PERSONAL_ACCOUNTS, off by default). It needs the app registration's signInAudience set to AzureADandPersonalMicrosoftAccount. Until it's on, the option isn't shown.
  • Consistent sign-in authority: sign-in, code exchange and every token refresh for a personal connection all go through /consumers.
  • No schema change: a pending sign-in is marked personal with the tenant hint consumers, or the consumer tenant id on reconnect.
  • Turning the setting off blocks new personal connections only. Existing ones keep refreshing and can still be reconnected.

Handling features personal accounts don't have

  • Permissions: personal sign-ins don't ask for permissions Microsoft only offers to work or school accounts: User.ReadBasic.All, Calendars.Read.Shared, Chat.Read, ChatMessage.Send.
  • Teams: the Teams tools and the connection lookup say Microsoft doesn't offer Teams chats to personal accounts, instead of telling the user to reconnect.
  • find_person: skips the company directory lookup for personal accounts.
  • suggest_meeting_times: uses a work calendar when one is available, and otherwise explains why it can't help.
  • Connections page: shows those features as "Not available on personal Microsoft accounts".

Testing

  • New PersonalMicrosoftAccountTests (12 tests) covers which sign-in each account type uses, which permissions are requested, no domain hint for personal accounts, the on/off setting including reconnect, account-type detection, and the messages shown to users.
  • Full suite in the dev container: 1,144 passed, 52 skipped, 20 failed. The 20 failures are the Web.* page tests, which need the dev Vault on :8200. That wasn't available, and they fail the same way on main. The dialog and connections-page changes have been compiled but not exercised by those tests.

Before merging

  • Turn on personal accounts in the app registration and set ENTRA_PERSONAL_ACCOUNTS=true
  • Connect a real outlook.com account: sign in, wait for a token refresh, check mail and calendar
  • Confirm the Teams and meeting-suggestion messages on that connection
  • Check whether check_availability (getSchedule) works for a personal account. It's unchanged here.
  • Run the Web.* tests with Vault up

Generated by Claude Code

Scott Singleton and others added 2 commits November 5, 2026 01:30
Personal accounts get their own sign-in path on /consumers, chosen up
front in the add-connection dialog. Work sign-ins stay on /organizations,
so Microsoft's picker never shows a work and a personal account with the
same address side by side (the wrong-mailbox trap /organizations exists
to avoid).

- EntraOptions.PersonalAccounts (off by default; needs the app
  registration's signInAudience = AzureADandPersonalMicrosoftAccount)
  and ConsumerAuthority.
- The authority follows the account on authorize, code redemption and
  every silent refresh.
- Personal accounts are not asked for work-only scopes (User.ReadBasic.All,
  Calendars.Read.Shared, Chat.Read, ChatMessage.Send).
- Pending sign-ins are marked personal with tenant hint "consumers", or
  the consumer tenant id on reconnect, so there is no schema change.
  Reconnecting an existing personal connection still works after the
  switch is turned off.
- Graceful degradation: Teams tools and the resolver say Microsoft does
  not offer the feature to personal accounts instead of asking for a
  reconnect; find_person skips the directory; suggest_meeting_times
  prefers a work calendar on fan-out and explains otherwise; the
  connections page labels these "Not available on personal Microsoft
  accounts".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7auris7aiG4VxGYpBMpuT
suggest_meeting_times was handled; check_availability was left to find out at
Graph, and the PR listed it as an unticked box. Microsoft's permissions table
for calendar: getSchedule settles it — "Delegated (personal Microsoft account)
| Not supported." — so a personal connection would have met an error where its
sibling explains itself.

Same shape as suggest_meeting_times: a personal account is last choice on a
fan-out rather than first, and a lone personal connection is told Microsoft
keeps other people's free/busy times to work or school accounts.

Also checked the other half of that question, since it would have been the next
surprise: /me/mailboxSettings IS supported for personal accounts, so exact times
print the account's own zone. Its format is whatever Microsoft returns with no
administrator to set one, and CalendarService.TryResolve (OP2-285) already tries
both the IANA and Windows spellings, so nothing is needed there.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7aurjxxqEYmeNDuAinHyQ
@BrewingCoder
BrewingCoder merged commit 200dc28 into main Nov 5, 2026
1 check passed
@BrewingCoder
BrewingCoder deleted the op2-81-personal-microsoft-accounts branch November 5, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant