@passflow/react 0.6.1 → 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/README.md +42 -0
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +341 -94
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/flow/upgrade-required-placeholder.d.ts +21 -0
- package/dist/src/components/flow/upgrade-required-placeholder.d.ts.map +1 -0
- package/dist/src/components/form/signin/index.d.ts.map +1 -1
- package/dist/src/components/provider/index.d.ts +2 -1
- package/dist/src/components/provider/index.d.ts.map +1 -1
- package/dist/src/components/provider/passflow-provider.d.ts +66 -1
- package/dist/src/components/provider/passflow-provider.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -3
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 |
|