Skip to content

Feature proposal: Microsoft Entra SSO for the agent/technician portal #1295

Description

@thvevirtue

Problem

The client portal already supports Microsoft Entra ID (Azure AD) SSO login (client/login_microsoft.php), but technicians/agents have no SSO option at all - only local username/password.

Proposed approach

  • A separate Entra App Registration for agent SSO (config_azure_agent_client_id / config_azure_agent_client_secret), distinct from the existing client portal app, so staff and client sign-in can be scoped/consented independently.
  • Settings > Identity Providers gains an "Agent/Technician Portal SSO" section to configure it, showing the redirect URI to register in Entra.
  • New agent/login_microsoft.php mirrors the client portal's existing OAuth2 authorization code flow, but matches the signed-in Microsoft account against the users table directly (user_type = 1, i.e. agents) and never joins against contacts/clients - so it cannot match a client portal account regardless of email overlap.
  • Technician accounts get an Auth Method selector (Local / Microsoft Entra) on the user edit modal, matching the existing pattern already used for client contacts.
  • A "Sign in as Agent with Microsoft Entra" button appears on the unified login page once an agent app registration is configured (hidden otherwise).
  • A DB migration adds the two new settings columns, following the existing per-version admin/database_updates/ convention.

This is incremental (no new runtime dependencies, no framework changes) and mirrors an existing, working pattern in the codebase rather than introducing a new one.

Status

Implemented and tested against a live install (fresh php -l sweep, end-to-end OAuth redirect test with a dummy App Registration, verified non-agent Entra accounts are cleanly rejected). Branch is ready on my fork: thvevirtue/itflow@master...thvevirtue:itflow:feature/agent-entra-sso

I understand PRs from the community are currently paused - opening this as an issue first per CONTRIBUTING.md's guidance to discuss approach before submitting anything larger than a bug fix. Happy to open a PR once the approach is agreed and/or PRs reopen.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions