Purpose: Complete guide for setting up Microsoft Entra ID/Office 365 integration for PF-63. Status: ✅ Setup Complete (2026-01-28)Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start (5 Minutes)
Prerequisites
- Azure CLI installed (
az --versionworks) - Azure account with Global Administrator or Application Administrator role
- Supabase project linked (
npx supabase link --project-ref zkgxozahyczcnzpwhbbf) - Supabase CLI available (via
npx supabase)
Automated Setup
Windows:- Create app registration
- Add API permissions
- Generate client secret (save it when shown!)
- Store secrets in Supabase
- Generate admin consent URL
- Create setup log
Manual Setup Steps
Step 1: Login to Azure
Step 2: Create App Registration
appId (Client ID) from the output.
Step 3: Add API Permissions
df021288-bdef-4463-88db-98f22de89214= User.ReadWrite.All (Application)1bfefb4e-e0b5-418b-a88f-73c46d2cc8e9= LicenseAssignment.ReadWrite.All (Application)
Step 4: Create Client Secret
password value immediately - it’s only shown once!
Step 5: Store Secrets in Supabase
Step 6: Grant Admin Consent
Generate the admin consent URL:Current Configuration
| Component | Value | Status |
|---|---|---|
| App ID (Client ID) | e02d8a52-e3e3-4569-a884-b7352619ec01 | ✅ Active |
| Tenant ID | 894b815c-98a1-4651-b498-ce5122f9bfe6 | ✅ Verified |
| Client Secret | Stored in Supabase secrets | ✅ Secure |
| Redirect URI | https://zkgxozahyczcnzpwhbbf.supabase.co/functions/v1/entra-oauth/callback | ✅ Configured |
| Admin Consent | Granted (2026-01-28) | ✅ Complete |
| Project | Production (zkgxozahyczcnzpwhbbf) | ✅ Linked |
Verification Checklist
Before starting implementation, verify:- Azure CLI installed and working
- Logged in to Azure CLI
- App registration created successfully
- API permissions added (User.ReadWrite.All, LicenseAssignment.ReadWrite.All)
- Client secret created and captured
- Secrets stored in Supabase
- Admin consent URL generated
- Callback handler deployed (
entra-oauthedge function) - Public access configured (
verify_jwt = falseinconfig.toml) - Admin consent granted
Troubleshooting
”Insufficient privileges”
- Solution: Ensure user has Global Administrator or Application Administrator role
”App registration not found”
- Solution: Verify APP_ID is correct, check with
az ad app list --display-name "Encore Health OS*"
”Permission not found”
- Solution: Verify permission IDs are correct, check Microsoft Graph API permission reference
”Client secret not shown”
- Solution: Secret is only shown once. If lost, create new secret with
az ad app credential reset
”Missing authorization header” (401 error)
- Solution: Ensure
verify_jwt = falseis set insupabase/config.tomlforentra-oauthfunction
Security Notes
- Client Secret: Only shown once during creation - save immediately
- Storage: For testing, use Supabase secrets. For production, will use per-organization Vault storage
- Documentation: Never commit client secrets to git
- Rotation: Client secrets expire in 2 years - plan rotation before expiration
Related Documentation
- Gap Analysis: archived at
docs/archive/integrations/ENTRA_ID_GAP_ANALYSIS.md(superseded by PF-63 implementation) - Research Findings: ENTRA_ID_RESEARCH_FINDINGS.md
- Overview: ENTRA_ID_OVERVIEW.md
- Specification:
specs/pf/specs/PF-63-entra-id-integration.md - Implementation Plan:
specs/pf/plans/PF-63-entra-id-integration-PLAN.md - Tasks:
specs/pf/tasks/PF-63-TASKS.md
Last Updated: 2026-01-28
Status: ✅ Setup Complete - Ready for Implementation