@flink-app/oidc-plugin 1.0.0 → 2.0.0-alpha.101

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +566 -0
  2. package/README.md +23 -2
  3. package/dist/OidcPlugin.d.ts +1 -1
  4. package/dist/OidcPlugin.d.ts.map +1 -1
  5. package/dist/OidcPlugin.js +32 -18
  6. package/dist/OidcPluginOptions.d.ts +75 -8
  7. package/dist/OidcPluginOptions.d.ts.map +1 -1
  8. package/dist/OidcProviderConfig.d.ts +21 -1
  9. package/dist/OidcProviderConfig.d.ts.map +1 -1
  10. package/dist/handlers/CallbackOidc.d.ts.map +1 -1
  11. package/dist/handlers/CallbackOidc.js +50 -5
  12. package/dist/handlers/InitiateOidc.d.ts.map +1 -1
  13. package/dist/handlers/InitiateOidc.js +14 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/log.d.ts +27 -0
  17. package/dist/log.d.ts.map +1 -0
  18. package/dist/log.js +37 -0
  19. package/dist/providers/OidcProvider.d.ts +1 -1
  20. package/dist/providers/OidcProvider.d.ts.map +1 -1
  21. package/dist/providers/OidcProvider.js +46 -5
  22. package/dist/providers/ProviderRegistry.d.ts +2 -1
  23. package/dist/providers/ProviderRegistry.d.ts.map +1 -1
  24. package/dist/providers/ProviderRegistry.js +10 -2
  25. package/dist/schemas/CallbackRequest.d.ts +3 -6
  26. package/dist/schemas/CallbackRequest.d.ts.map +1 -1
  27. package/dist/schemas/InitiateRequest.d.ts +3 -6
  28. package/dist/schemas/InitiateRequest.d.ts.map +1 -1
  29. package/dist/schemas/OidcSession.d.ts +5 -0
  30. package/dist/schemas/OidcSession.d.ts.map +1 -1
  31. package/dist/utils/response-utils.d.ts +16 -5
  32. package/dist/utils/response-utils.d.ts.map +1 -1
  33. package/dist/utils/response-utils.js +31 -10
  34. package/examples/multi-provider.ts +1 -1
  35. package/package.json +8 -11
  36. package/spec/helpers/test-helpers.ts +14 -0
  37. package/spec/plugin/OidcPlugin.spec.ts +104 -3
  38. package/spec/providers/ProviderRegistry.spec.ts +8 -7
  39. package/spec/utils/response-utils.spec.ts +85 -0
  40. package/src/OidcPlugin.ts +54 -21
  41. package/src/OidcPluginOptions.ts +84 -9
  42. package/src/OidcProviderConfig.ts +23 -1
  43. package/src/handlers/CallbackOidc.ts +66 -5
  44. package/src/handlers/InitiateOidc.ts +19 -1
  45. package/src/index.ts +1 -1
  46. package/src/log.ts +33 -0
  47. package/src/providers/OidcProvider.ts +60 -7
  48. package/src/providers/ProviderRegistry.ts +22 -3
  49. package/src/schemas/CallbackRequest.ts +4 -6
  50. package/src/schemas/InitiateRequest.ts +3 -6
  51. package/src/schemas/OidcSession.ts +6 -0
  52. package/src/utils/response-utils.ts +53 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,571 @@
1
1
  # @flink-app/oidc-plugin
2
2
 
3
+ ## 2.0.0-alpha.101
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [b11f2f8]
8
+ - @flink-app/flink@2.0.0-alpha.101
9
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.101
10
+
11
+ ## 2.0.0-alpha.100
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [6e8166a]
16
+ - @flink-app/flink@2.0.0-alpha.100
17
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.100
18
+
19
+ ## 2.0.0-alpha.99
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [ed9cd2c]
24
+ - @flink-app/flink@2.0.0-alpha.99
25
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.99
26
+
27
+ ## 2.0.0-alpha.98
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [2f4a132]
32
+ - @flink-app/flink@2.0.0-alpha.98
33
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.98
34
+
35
+ ## 2.0.0-alpha.97
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies [eed6bc1]
40
+ - @flink-app/flink@2.0.0-alpha.97
41
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.97
42
+
43
+ ## 2.0.0-alpha.96
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies
48
+ - Updated dependencies [e431237]
49
+ - @flink-app/flink@2.0.0-alpha.96
50
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.96
51
+
52
+ ## 2.0.0-alpha.95
53
+
54
+ ### Patch Changes
55
+
56
+ - @flink-app/flink@2.0.0-alpha.95
57
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.95
58
+
59
+ ## 2.0.0-alpha.94
60
+
61
+ ### Patch Changes
62
+
63
+ - @flink-app/flink@2.0.0-alpha.94
64
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.94
65
+
66
+ ## 2.0.0-alpha.93
67
+
68
+ ### Patch Changes
69
+
70
+ - @flink-app/flink@2.0.0-alpha.93
71
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.93
72
+
73
+ ## 2.0.0-alpha.92
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies [8d23d56]
78
+ - @flink-app/flink@2.0.0-alpha.92
79
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.92
80
+
81
+ ## 2.0.0-alpha.91
82
+
83
+ ### Minor Changes
84
+
85
+ - 1bdbc82: feat(oidc-plugin): add per-provider `useUserInfoEndpoint` config flag (default `true`) to disable UserInfo calls for IdPs where the endpoint is unreliable or redundant with ID token claims
86
+
87
+ ### Patch Changes
88
+
89
+ - @flink-app/flink@2.0.0-alpha.91
90
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.91
91
+
92
+ ## 2.0.0-alpha.90
93
+
94
+ ### Patch Changes
95
+
96
+ - e18a37b: Add raw IdP response trace logs and prune redundant debug logs
97
+ - Updated dependencies [0d84b5f]
98
+ - @flink-app/flink@2.0.0-alpha.90
99
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.90
100
+
101
+ ## 2.0.0-alpha.89
102
+
103
+ ### Patch Changes
104
+
105
+ - Fix OIDC trace logs
106
+ - @flink-app/flink@2.0.0-alpha.89
107
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.89
108
+
109
+ ## 2.0.0-alpha.88
110
+
111
+ ### Patch Changes
112
+
113
+ - 5f3919e: fix(oidc-plugin): use discovered userinfo endpoint in buildProfile when no manual endpoint is configured
114
+ - @flink-app/flink@2.0.0-alpha.88
115
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.88
116
+
117
+ ## 2.0.0-alpha.87
118
+
119
+ ### Patch Changes
120
+
121
+ - Updated dependencies
122
+ - @flink-app/flink@2.0.0-alpha.87
123
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.87
124
+
125
+ ## 2.0.0-alpha.86
126
+
127
+ ### Patch Changes
128
+
129
+ - 4219f07: Add `tokenDelivery` option to control how the JWT is attached to the post-callback redirect URL. Defaults to `"fragment"` (unchanged — `#token=...` is still appended for browser flows where URL fragments are not sent to the server). Set to `"query"` for native mobile flows where iOS `ASWebAuthenticationSession` strips fragments from custom-scheme callbacks, or pass a function `({ redirectUrl, provider, metadata }) => "fragment" | "query"` to decide per-request when one app serves both web and native clients. The plugin makes no scheme-based assumptions — policy lives in the host app.
130
+ - @flink-app/flink@2.0.0-alpha.86
131
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.86
132
+
133
+ ## 2.0.0-alpha.85
134
+
135
+ ### Patch Changes
136
+
137
+ - Updated dependencies [179c085]
138
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.85
139
+ - @flink-app/flink@2.0.0-alpha.85
140
+
141
+ ## 2.0.0-alpha.84
142
+
143
+ ### Patch Changes
144
+
145
+ - @flink-app/flink@2.0.0-alpha.84
146
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.84
147
+
148
+ ## 2.0.0-alpha.83
149
+
150
+ ### Patch Changes
151
+
152
+ - Updated dependencies
153
+ - @flink-app/flink@2.0.0-alpha.83
154
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.83
155
+
156
+ ## 2.0.0-alpha.82
157
+
158
+ ### Patch Changes
159
+
160
+ - Add metadata passthrough support. Any query parameters prefixed with `meta.` on the initiate endpoint (e.g. `?meta.intent=admin&meta.source=mobile`) are collected, stripped of the prefix, stored in the session, and delivered to both `onAuthSuccess` and `onAuthError` callbacks as `metadata: Record<string, string>`. Empty object when no meta params are provided.
161
+ - @flink-app/flink@2.0.0-alpha.82
162
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.82
163
+
164
+ ## 2.0.0-alpha.81
165
+
166
+ ### Patch Changes
167
+
168
+ - @flink-app/flink@2.0.0-alpha.81
169
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.81
170
+
171
+ ## 2.0.0-alpha.80
172
+
173
+ ### Patch Changes
174
+
175
+ - Add flink.oidc named logger with debug instrumentation across init, provider resolution, and auth flow
176
+ - @flink-app/flink@2.0.0-alpha.80
177
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.80
178
+
179
+ ## 2.0.0-alpha.79
180
+
181
+ ### Patch Changes
182
+
183
+ - Expose redirectUri from session in onAuthSuccess and onAuthError callbacks, enabling multi-client redirect decisions
184
+ - @flink-app/flink@2.0.0-alpha.79
185
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.79
186
+
187
+ ## 2.0.0-alpha.78
188
+
189
+ ### Patch Changes
190
+
191
+ - Fix optional chaining on providers in handlers after making providers optional
192
+ - @flink-app/flink@2.0.0-alpha.78
193
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.78
194
+
195
+ ## 2.0.0-alpha.77
196
+
197
+ ### Minor Changes
198
+
199
+ - Make providers optional when providerLoader is configured, add TCtx generic for typed ctx in providerLoader and onAuthSuccess callbacks
200
+
201
+ ### Patch Changes
202
+
203
+ - @flink-app/flink@2.0.0-alpha.77
204
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.77
205
+
206
+ ## 2.0.0-alpha.76
207
+
208
+ ### Patch Changes
209
+
210
+ - Updated dependencies
211
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.76
212
+ - @flink-app/flink@2.0.0-alpha.76
213
+
214
+ ## 2.0.0-alpha.75
215
+
216
+ ### Patch Changes
217
+
218
+ - @flink-app/flink@2.0.0-alpha.75
219
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.75
220
+
221
+ ## 2.0.0-alpha.74
222
+
223
+ ### Patch Changes
224
+
225
+ - Updated dependencies
226
+ - Updated dependencies
227
+ - @flink-app/flink@2.0.0-alpha.74
228
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.74
229
+
230
+ ## 2.0.0-alpha.73
231
+
232
+ ### Patch Changes
233
+
234
+ - Updated dependencies
235
+ - @flink-app/flink@2.0.0-alpha.73
236
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.73
237
+
238
+ ## 2.0.0-alpha.72
239
+
240
+ ### Patch Changes
241
+
242
+ - Updated dependencies
243
+ - @flink-app/flink@2.0.0-alpha.72
244
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.72
245
+
246
+ ## 2.0.0-alpha.71
247
+
248
+ ### Patch Changes
249
+
250
+ - @flink-app/flink@2.0.0-alpha.71
251
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.71
252
+
253
+ ## 2.0.0-alpha.70
254
+
255
+ ### Patch Changes
256
+
257
+ - @flink-app/flink@2.0.0-alpha.70
258
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.70
259
+
260
+ ## 2.0.0-alpha.69
261
+
262
+ ### Minor Changes
263
+
264
+ - feat(oidc-plugin): support public clients with PKCE-only authentication (no client secret)
265
+
266
+ `clientSecret` is now optional in `OidcProviderConfig`. When omitted, the plugin configures `openid-client` with `token_endpoint_auth_method: "none"` for public client flows. Added `tokenEndpointAuthMethod` option for explicit control. Encryption key derivation skips providers without a secret, and `storeTokens: true` requires an explicit `encryptionKey` when no provider has a client secret.
267
+
268
+ ### Patch Changes
269
+
270
+ - @flink-app/flink@2.0.0-alpha.69
271
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.69
272
+
273
+ ## 2.0.0-alpha.68
274
+
275
+ ### Patch Changes
276
+
277
+ - @flink-app/flink@2.0.0-alpha.68
278
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.68
279
+
280
+ ## 2.0.0-alpha.67
281
+
282
+ ### Patch Changes
283
+
284
+ - Updated dependencies [418cb54]
285
+ - Updated dependencies [70d574c]
286
+ - @flink-app/flink@2.0.0-alpha.67
287
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.67
288
+
289
+ ## 2.0.0-alpha.66
290
+
291
+ ### Patch Changes
292
+
293
+ - Updated dependencies [5593d26]
294
+ - @flink-app/flink@2.0.0-alpha.66
295
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.66
296
+
297
+ ## 2.0.0-alpha.65
298
+
299
+ ### Patch Changes
300
+
301
+ - @flink-app/flink@2.0.0-alpha.65
302
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.65
303
+
304
+ ## 2.0.0-alpha.64
305
+
306
+ ### Patch Changes
307
+
308
+ - Updated dependencies [95b99ee]
309
+ - @flink-app/flink@2.0.0-alpha.64
310
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.64
311
+
312
+ ## 2.0.0-alpha.63
313
+
314
+ ### Patch Changes
315
+
316
+ - Updated dependencies [810df2c]
317
+ - Updated dependencies [8dd0752]
318
+ - @flink-app/flink@2.0.0-alpha.63
319
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.63
320
+
321
+ ## 2.0.0-alpha.62
322
+
323
+ ### Patch Changes
324
+
325
+ - Updated dependencies
326
+ - @flink-app/flink@2.0.0-alpha.62
327
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.62
328
+
329
+ ## 2.0.0-alpha.61
330
+
331
+ ### Patch Changes
332
+
333
+ - @flink-app/flink@2.0.0-alpha.61
334
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.61
335
+
336
+ ## 2.0.0-alpha.60
337
+
338
+ ### Patch Changes
339
+
340
+ - @flink-app/flink@2.0.0-alpha.60
341
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.60
342
+
343
+ ## 2.0.0-alpha.59
344
+
345
+ ### Patch Changes
346
+
347
+ - Updated dependencies [dbc2119]
348
+ - @flink-app/flink@2.0.0-alpha.59
349
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.59
350
+
351
+ ## 2.0.0-alpha.58
352
+
353
+ ### Patch Changes
354
+
355
+ - Updated dependencies
356
+ - @flink-app/flink@2.0.0-alpha.58
357
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.58
358
+
359
+ ## 2.0.0-alpha.57
360
+
361
+ ### Patch Changes
362
+
363
+ - Updated dependencies [ef7f495]
364
+ - Updated dependencies [2d53aa4]
365
+ - Updated dependencies [b3cc5d1]
366
+ - Updated dependencies [d377fac]
367
+ - Updated dependencies [4ad44c0]
368
+ - Updated dependencies [90f80c7]
369
+ - Updated dependencies [f0887e7]
370
+ - Updated dependencies [68c46d3]
371
+ - Updated dependencies [4ad44c0]
372
+ - Updated dependencies
373
+ - @flink-app/flink@2.0.0-alpha.57
374
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.57
375
+
376
+ ## 2.0.0-alpha.56
377
+
378
+ ### Patch Changes
379
+
380
+ - Zod 3.x compat
381
+ - Updated dependencies
382
+ - Updated dependencies [0203256]
383
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.56
384
+ - @flink-app/flink@2.0.0-alpha.56
385
+
386
+ ## 2.0.0-alpha.55
387
+
388
+ ### Patch Changes
389
+
390
+ - Updated dependencies [3267206]
391
+ - Updated dependencies [497b7c2]
392
+ - Updated dependencies [3267206]
393
+ - @flink-app/flink@2.0.0-alpha.55
394
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.55
395
+
396
+ ## 2.0.0-alpha.53
397
+
398
+ ### Patch Changes
399
+
400
+ - Updated dependencies [669c806]
401
+ - @flink-app/flink@2.0.0-alpha.53
402
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.53
403
+
404
+ ## 2.0.0-alpha.52
405
+
406
+ ### Patch Changes
407
+
408
+ - Updated dependencies [fe9f8f2]
409
+ - @flink-app/flink@2.0.0-alpha.52
410
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.52
411
+
412
+ ## 2.0.0-alpha.51
413
+
414
+ ### Patch Changes
415
+
416
+ - fix: add peerDependencies to all plugins and adapters
417
+
418
+ **Breaking Change Prevention:**
419
+
420
+ - Added "@flink-app/flink": ">=2.0.0-alpha.0" as peerDependency to all plugins
421
+ - Fixed oidc-plugin peerDependencies from "workspace:\*" to proper version ranges
422
+ - Fixed oauth-plugin to include @flink-app/flink peerDependency
423
+
424
+ **JWT Auth Plugin Interface Fix:**
425
+
426
+ - Removed redundant createToken declaration from JwtAuthPlugin interface
427
+ - The method is already inherited from FlinkAuthPlugin, this fixes TypeScript type checking issues
428
+
429
+ **Why this matters:**
430
+
431
+ - Ensures only one version of @flink-app/flink exists in node_modules
432
+ - Prevents type conflicts when TypeScript resolves interfaces across packages
433
+ - Follows standard plugin architecture best practices (same pattern as React, Webpack, etc.)
434
+ - Package managers now warn if incompatible versions are installed
435
+
436
+ - Updated dependencies
437
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.51
438
+ - @flink-app/flink@2.0.0-alpha.51
439
+
440
+ ## 2.0.0-alpha.50
441
+
442
+ ### Patch Changes
443
+
444
+ - Updated dependencies
445
+ - @flink-app/flink@2.0.0-alpha.50
446
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.50
447
+
448
+ ## 2.0.0-alpha.49
449
+
450
+ ### Patch Changes
451
+
452
+ - Typescript include fix
453
+ - Updated dependencies
454
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.49
455
+ - @flink-app/flink@2.0.0-alpha.49
456
+
457
+ ## 2.0.0-alpha.48
458
+
459
+ ### Patch Changes
460
+
461
+ - Updated dependencies
462
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.48
463
+ - @flink-app/flink@2.0.0-alpha.48
464
+
465
+ ## 1.0.0
466
+
467
+ ### Minor Changes
468
+
469
+ - Align minor version, from now all packages in monorepo will have same version
470
+
471
+ ### Patch Changes
472
+
473
+ - ee21c29: Normalize query parameters to predictable string types
474
+
475
+ Query parameters are now automatically normalized to `string | string[]` types before reaching handlers:
476
+
477
+ - Single values: converted to strings (e.g., `?page=1` → `{ page: "1" }`)
478
+ - Repeated parameters: converted to string arrays (e.g., `?tag=a&tag=b` → `{ tag: ["a", "b"] }`)
479
+ - All types (numbers, booleans, etc.) from Express parser are converted to strings
480
+
481
+ **Breaking Change (Minor):**
482
+
483
+ - `Query` type changed from `{ [x: string]: string | string[] | undefined }` to `Record<string, string | string[]>`
484
+ - `Params` type changed from `Request["params"]` to explicit `Record<string, string>`
485
+ - Removed `undefined` from query/param types since normalization ensures values are never undefined
486
+ - Updated OAuth and OIDC plugin query type definitions to satisfy new Query constraint
487
+
488
+ This ensures predictable query and path parameter handling regardless of Express parser configuration. Handlers can reliably parse string values as needed using `Number()`, `parseInt()`, boolean comparisons, etc.
489
+
490
+ - Updated dependencies
491
+ - Updated dependencies [ee21c29]
492
+ - Updated dependencies [5c2ff97]
493
+ - @flink-app/flink@1.0.0
494
+ - @flink-app/jwt-auth-plugin@1.0.0
495
+
496
+ ## 0.14.3
497
+
498
+ ### Patch Changes
499
+
500
+ - Updated dependencies [52eba74]
501
+ - Updated dependencies [b37faa5]
502
+ - @flink-app/flink@0.14.3
503
+ - @flink-app/jwt-auth-plugin@0.14.1
504
+
505
+ ## 0.14.2
506
+
507
+ ### Patch Changes
508
+
509
+ - Updated dependencies [6d39832]
510
+ - @flink-app/flink@0.14.2
511
+ - @flink-app/jwt-auth-plugin@0.14.1
512
+
513
+ ## 0.14.1
514
+
515
+ ### Patch Changes
516
+
517
+ - fix: restore compatibility between core framework and plugins after 0.14.0 release
518
+
519
+ ## 1.0.0
520
+
521
+ ### Patch Changes
522
+
523
+ - Updated dependencies [7da5227]
524
+ - Updated dependencies [8ad040f]
525
+ - @flink-app/flink@0.14.0
526
+ - @flink-app/jwt-auth-plugin@0.13.1
527
+
528
+ ## 0.13.5
529
+
530
+ ### Patch Changes
531
+
532
+ - Updated dependencies
533
+ - @flink-app/flink@0.13.5
534
+ - @flink-app/jwt-auth-plugin@0.13.1
535
+
536
+ ## 0.13.4
537
+
538
+ ### Patch Changes
539
+
540
+ - Updated dependencies
541
+ - @flink-app/flink@0.13.4
542
+ - @flink-app/jwt-auth-plugin@0.13.1
543
+
544
+ ## 0.13.3
545
+
546
+ ### Patch Changes
547
+
548
+ - Updated dependencies
549
+ - @flink-app/flink@0.13.3
550
+ - @flink-app/jwt-auth-plugin@0.13.1
551
+
552
+ ## 0.13.2
553
+
554
+ ### Patch Changes
555
+
556
+ - Updated dependencies
557
+ - @flink-app/flink@0.13.2
558
+ - @flink-app/jwt-auth-plugin@0.13.1
559
+
560
+ ## 0.13.1
561
+
562
+ ### Patch Changes
563
+
564
+ - Fixed invalid types and improve typescript error message during schema compilation
565
+ - Updated dependencies
566
+ - @flink-app/jwt-auth-plugin@0.13.1
567
+ - @flink-app/flink@0.13.1
568
+
3
569
  ## 1.0.0
4
570
 
5
571
  ### Minor Changes
package/README.md CHANGED
@@ -203,6 +203,26 @@ await app.start();
203
203
  }
204
204
  ```
205
205
 
206
+ #### Disabling the UserInfo endpoint
207
+
208
+ By default, the plugin calls the UserInfo endpoint after token exchange to
209
+ enrich the profile with additional claims. Some IdPs either don't expose
210
+ extra claims beyond the ID token or return unreliable 5xx errors from
211
+ UserInfo. In those cases, set `useUserInfoEndpoint: false` on the provider
212
+ config to skip the UserInfo call entirely and build profiles from ID token
213
+ claims only:
214
+
215
+ ```typescript
216
+ {
217
+ issuer: "https://idp.acme.com",
218
+ clientId: "your-client-id",
219
+ clientSecret: "your-client-secret",
220
+ callbackUrl: "https://myapp.com/oidc/acme/callback",
221
+ discoveryUrl: "https://idp.acme.com/.well-known/openid-configuration",
222
+ useUserInfoEndpoint: false, // skip UserInfo; use ID token claims only
223
+ }
224
+ ```
225
+
206
226
  ### Callback Functions
207
227
 
208
228
  #### onAuthSuccess
@@ -500,7 +520,7 @@ onAuthSuccess: async ({ profile, claims }, ctx) => {
500
520
  subject: claims.sub,
501
521
  provider: "acme",
502
522
  });
503
- await ctx.repos.userRepo.updateOne(user._id, {
523
+ await ctx.repos.userRepo.updateById(user._id, {
504
524
  oidcConnections: user.oidcConnections,
505
525
  });
506
526
  } else {
@@ -552,7 +572,7 @@ onAuthSuccess: async ({ profile, claims }, ctx) => {
552
572
  });
553
573
  } else {
554
574
  // Update roles on each login
555
- await ctx.repos.userRepo.updateOne(user._id, { roles });
575
+ await ctx.repos.userRepo.updateById(user._id, { roles });
556
576
  }
557
577
 
558
578
  const token = await ctx.plugins.jwtAuth.createToken({ userId: user._id }, roles);
@@ -619,6 +639,7 @@ interface OidcProviderConfigDB {
619
639
  authorizationEndpoint?: string;
620
640
  tokenEndpoint?: string;
621
641
  userinfoEndpoint?: string;
642
+ useUserInfoEndpoint?: boolean; // default true
622
643
  jwksUri?: string;
623
644
  scope: string[];
624
645
  createdAt: Date;
@@ -73,5 +73,5 @@ import { OidcPluginOptions } from "./OidcPluginOptions";
73
73
  * });
74
74
  * ```
75
75
  */
76
- export declare function oidcPlugin(options: OidcPluginOptions): FlinkPlugin;
76
+ export declare function oidcPlugin<TCtx = any>(options: OidcPluginOptions<TCtx>): FlinkPlugin;
77
77
  //# sourceMappingURL=OidcPlugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OidcPlugin.d.ts","sourceRoot":"","sources":["../src/OidcPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAO,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAWxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,WAAW,CA2MlE"}
1
+ {"version":3,"file":"OidcPlugin.d.ts","sourceRoot":"","sources":["../src/OidcPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAO,MAAM,kBAAkB,CAAC;AAG9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAWxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,wBAAgB,UAAU,CAAC,IAAI,GAAG,GAAG,EAAE,OAAO,EAAE,iBAAiB,CAAC,IAAI,CAAC,GAAG,WAAW,CA2OpF"}