@passflow/react 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 MadAppGang Pty Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -188,6 +188,48 @@ export const App = () => (
188
188
  </BrowserRouter>
189
189
  );
190
190
  ```
191
+
192
+ ### Built-in OIDC RP integration
193
+
194
+ `<PassflowProvider>` is also a full OIDC relying-party SDK out of the
195
+ box. When a `parent_challenge_id` query parameter is present on the
196
+ host page's URL (typical of a Passflow OP redirect to the login UI),
197
+ the provider:
198
+
199
+ 1. **Installs an interceptor** on `window.fetch` and
200
+ `XMLHttpRequest.prototype.{open,send}` that injects
201
+ `parent_challenge_id` on every outbound Passflow auth POST body
202
+ and follows server-returned `{redirect_url}` JSON responses with
203
+ `window.location.assign`. Covers `/auth/login`,
204
+ `/auth/passwordless/*`, `/auth/passkey/*`, `/auth/2fa/*`,
205
+ `/auth/federated/start`, and `/auth/session/exchange`.
206
+
207
+ 2. **Runs an exchange-on-mount probe.** If the SDK has existing
208
+ tokens AND the parent challenge allows it (`prompt=login` not
209
+ set, `max_age` not exceeded), the provider POSTs
210
+ `/auth/session/exchange` with the current access token and
211
+ navigates the browser when the server returns a redirect URL.
212
+ This satisfies OIDC Core §3.1.2.1 / §3.1.2.4 (`prompt=none`,
213
+ `max_age`, `id_token_hint`) without re-prompting an
214
+ already-authenticated user.
215
+
216
+ 3. **Renders a placeholder during exchange** (theme via the
217
+ `continuingToAppPlaceholder` prop on PassflowFlow — TODO once
218
+ the prop is wired through; today the default placeholder
219
+ appears).
220
+
221
+ 4. **Falls through to the login form** when exchange is impossible
222
+ or returns `403 upgrade_required`. The login form gets an
223
+ explanatory banner (also themeable).
224
+
225
+ Consumer code remains a single line of plumbing — mount
226
+ `<PassflowProvider>`, render `<PassflowFlow>` inside, done. No
227
+ manual interceptor wiring required.
228
+
229
+ See the project's `docs/adr/0002-session-exchange-endpoint.md` for
230
+ the server contract and `docs/adr/0003-amr-acr-claims.md` for the
231
+ authentication-context claims those tokens carry.
232
+
191
233
  ### PassflowFlow
192
234
 
193
235
  | Prop | Type | Description |