Commit f3b7d9b
authored
Add design documentation for Mobile MDM Onboarding & In-App Enrollment Flow (#1691)
Documents the architecture and implementation details of PR #1689's
in-app MDM profile installation and enrollment support for MSAL
Objective-C.
## Added
- **Design document** at `docs/design/mobile-mdm-onboarding-design.md`
covering:
- Architecture flow for embedded WKWebView → ASWebAuthenticationSession
transitions
- New components: navigation action resolver, transition coordinator,
MDM response models
- Modified components: local interactive controller, AAD webview
controller, request/response pipeline
- `msauth://` URL scheme routing for profile installation and enrollment
completion
- Broker Refresh Token (BRT) acquisition strategy
- Post-enrollment handoff to SSO Extension
- Risk assessment and known incomplete items (BRT placeholder, dual
transition paths, no tests)
## Structure
```
docs/
└── design/
└── mobile-mdm-onboarding-design.md # 266 lines, 11 sections
```
Document includes flow diagrams, component tables, and files changed
summary for the 38-file, +2,814/-37 line change in PR #1689.
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
Add a comprehensive design document as a markdown file to the repository
that documents the changes introduced in PR #1689 (`veena/mob_onb2`
branch). The design doc should be placed at
`docs/design/mobile-mdm-onboarding-design.md` and contain the following
content exactly:
---
# Design Document: Mobile MDM Onboarding & In-App Enrollment Flow
**PR:** [#1689 – Veena/mob
onb2](#1689)
**Branch:** `veena/mob_onb2` → `dev`
**Repository:**
`AzureAD/microsoft-authentication-library-common-for-objc`
**Author:** @swasti29
**Status:** Draft, Open
**Stats:** +2,814 additions, -37 deletions across 38 files
---
## 1. Executive Summary
This change introduces **in-app MDM (Mobile Device Management) profile
installation and enrollment** support into the MSAL common library for
Objective-C. It enables an interactive authentication flow where, when
the AAD server signals that an Intune management profile must be
installed, the embedded webview (WKWebView) seamlessly transitions to an
`ASWebAuthenticationSession` for profile installation, then returns to
the embedded webview to complete the original authentication.
Additionally, it introduces **Broker Refresh Token (BRT)** acquisition
logic triggered on special `msauth://` and `browser://` redirects.
---
## 2. Problem Statement
Currently, when AAD determines that a device requires MDM enrollment
(Intune profile installation) before authentication can complete, the
library lacks the ability to:
1. **Detect** an MDM profile installation trigger
(`msauth://installProfile`) from the server.
2. **Orchestrate** a seamless transition from the embedded webview to
`ASWebAuthenticationSession` for profile download (which requires
system-level handling).
3. **Resume** the embedded webview after profile installation completes
(`msauth://in_app_enrollment_complete`).
4. **Acquire a Broker Refresh Token (BRT)** opportunistically on special
redirect schemes.
5. **Hand off to the broker** (SSO Extension) after successful
enrollment for final token acquisition.
---
## 3. Architecture Overview
### 3.1 High-Level Flow
```
┌──────────────┐ ┌─────────────────────┐ ┌──────────────────────────┐
│ App calls │────▶│ LocalInteractive │────▶│ Embedded WKWebview │
│ acquireToken │ │ Controller │ │ (AAD login page) │
└──────────────┘ └─────────────────────┘ └──────────┬───────────────┘
│
┌──────────────────────────────────┤
│ Server returns msauth:// │
│ installProfile redirect │
▼ │
┌──────────────────────┐ │
│ SpecialNavigation │ Delegate intercepts │
│ Delegate callback │◀──────────────────────┘
└──────┬───────────────┘
│ 1. Acquire BRT (first time only)
│ 2. Resolve navigation action
▼
┌──────────────────────┐
│ NavigationActionUtil │ Parses msauth:// URL
│ resolves action │ + HTTP response headers
└──────┬───────────────┘
│ Returns: OpenInASWebAuthSession
▼
┌──────────────────────┐ ┌─────────────────────────┐
│ TransitionCoordinator│────▶│ ASWebAuthenticationSession│
│ - Suspend WKWebview │ │ (Profile installation) │
│ - Launch ASWebAuth │ └──────────┬──────────────┘
└──────────────────────┘ │
│ Callback:
│ msauth://in_app_enrollment_complete
▼
┌──────────────────────┐ ┌──────────────────────────┐
│ TransitionCoordinator│────▶│ Resume WKWebview │
│ - Resume webview │ │ Load enrollment callback │
│ - Clean up ASWebAuth │ └──────────┬───────────────┘
└──────────────────────┘ │
│ WKWebview processes
│ enrollment completion
▼
┌──────────────────────────────────────────────────────┐
│ Controller handles MDMEnrollmentCompletionResponse │
│ → Creates BrokerInteractiveController │
│ → Delegates to SSO Extension for final token │
└─────────────────────────────────────────────────────┘
```
---
## 4. New Components
### 4.1 New Classes
| Class | Location | Purpose |
|---|---|---|
| **`...
</details>
<!-- START COPILOT CODING AGENT SUFFIX -->
*This pull request was created from Copilot chat.*
>
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).1 file changed
+266
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
0 commit comments