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

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 +558 -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,563 @@
1
1
  # @flink-app/oidc-plugin
2
2
 
3
+ ## 2.0.0-alpha.100
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [6e8166a]
8
+ - @flink-app/flink@2.0.0-alpha.100
9
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.100
10
+
11
+ ## 2.0.0-alpha.99
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [ed9cd2c]
16
+ - @flink-app/flink@2.0.0-alpha.99
17
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.99
18
+
19
+ ## 2.0.0-alpha.98
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [2f4a132]
24
+ - @flink-app/flink@2.0.0-alpha.98
25
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.98
26
+
27
+ ## 2.0.0-alpha.97
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [eed6bc1]
32
+ - @flink-app/flink@2.0.0-alpha.97
33
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.97
34
+
35
+ ## 2.0.0-alpha.96
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies
40
+ - Updated dependencies [e431237]
41
+ - @flink-app/flink@2.0.0-alpha.96
42
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.96
43
+
44
+ ## 2.0.0-alpha.95
45
+
46
+ ### Patch Changes
47
+
48
+ - @flink-app/flink@2.0.0-alpha.95
49
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.95
50
+
51
+ ## 2.0.0-alpha.94
52
+
53
+ ### Patch Changes
54
+
55
+ - @flink-app/flink@2.0.0-alpha.94
56
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.94
57
+
58
+ ## 2.0.0-alpha.93
59
+
60
+ ### Patch Changes
61
+
62
+ - @flink-app/flink@2.0.0-alpha.93
63
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.93
64
+
65
+ ## 2.0.0-alpha.92
66
+
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [8d23d56]
70
+ - @flink-app/flink@2.0.0-alpha.92
71
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.92
72
+
73
+ ## 2.0.0-alpha.91
74
+
75
+ ### Minor Changes
76
+
77
+ - 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
78
+
79
+ ### Patch Changes
80
+
81
+ - @flink-app/flink@2.0.0-alpha.91
82
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.91
83
+
84
+ ## 2.0.0-alpha.90
85
+
86
+ ### Patch Changes
87
+
88
+ - e18a37b: Add raw IdP response trace logs and prune redundant debug logs
89
+ - Updated dependencies [0d84b5f]
90
+ - @flink-app/flink@2.0.0-alpha.90
91
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.90
92
+
93
+ ## 2.0.0-alpha.89
94
+
95
+ ### Patch Changes
96
+
97
+ - Fix OIDC trace logs
98
+ - @flink-app/flink@2.0.0-alpha.89
99
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.89
100
+
101
+ ## 2.0.0-alpha.88
102
+
103
+ ### Patch Changes
104
+
105
+ - 5f3919e: fix(oidc-plugin): use discovered userinfo endpoint in buildProfile when no manual endpoint is configured
106
+ - @flink-app/flink@2.0.0-alpha.88
107
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.88
108
+
109
+ ## 2.0.0-alpha.87
110
+
111
+ ### Patch Changes
112
+
113
+ - Updated dependencies
114
+ - @flink-app/flink@2.0.0-alpha.87
115
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.87
116
+
117
+ ## 2.0.0-alpha.86
118
+
119
+ ### Patch Changes
120
+
121
+ - 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.
122
+ - @flink-app/flink@2.0.0-alpha.86
123
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.86
124
+
125
+ ## 2.0.0-alpha.85
126
+
127
+ ### Patch Changes
128
+
129
+ - Updated dependencies [179c085]
130
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.85
131
+ - @flink-app/flink@2.0.0-alpha.85
132
+
133
+ ## 2.0.0-alpha.84
134
+
135
+ ### Patch Changes
136
+
137
+ - @flink-app/flink@2.0.0-alpha.84
138
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.84
139
+
140
+ ## 2.0.0-alpha.83
141
+
142
+ ### Patch Changes
143
+
144
+ - Updated dependencies
145
+ - @flink-app/flink@2.0.0-alpha.83
146
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.83
147
+
148
+ ## 2.0.0-alpha.82
149
+
150
+ ### Patch Changes
151
+
152
+ - 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.
153
+ - @flink-app/flink@2.0.0-alpha.82
154
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.82
155
+
156
+ ## 2.0.0-alpha.81
157
+
158
+ ### Patch Changes
159
+
160
+ - @flink-app/flink@2.0.0-alpha.81
161
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.81
162
+
163
+ ## 2.0.0-alpha.80
164
+
165
+ ### Patch Changes
166
+
167
+ - Add flink.oidc named logger with debug instrumentation across init, provider resolution, and auth flow
168
+ - @flink-app/flink@2.0.0-alpha.80
169
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.80
170
+
171
+ ## 2.0.0-alpha.79
172
+
173
+ ### Patch Changes
174
+
175
+ - Expose redirectUri from session in onAuthSuccess and onAuthError callbacks, enabling multi-client redirect decisions
176
+ - @flink-app/flink@2.0.0-alpha.79
177
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.79
178
+
179
+ ## 2.0.0-alpha.78
180
+
181
+ ### Patch Changes
182
+
183
+ - Fix optional chaining on providers in handlers after making providers optional
184
+ - @flink-app/flink@2.0.0-alpha.78
185
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.78
186
+
187
+ ## 2.0.0-alpha.77
188
+
189
+ ### Minor Changes
190
+
191
+ - Make providers optional when providerLoader is configured, add TCtx generic for typed ctx in providerLoader and onAuthSuccess callbacks
192
+
193
+ ### Patch Changes
194
+
195
+ - @flink-app/flink@2.0.0-alpha.77
196
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.77
197
+
198
+ ## 2.0.0-alpha.76
199
+
200
+ ### Patch Changes
201
+
202
+ - Updated dependencies
203
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.76
204
+ - @flink-app/flink@2.0.0-alpha.76
205
+
206
+ ## 2.0.0-alpha.75
207
+
208
+ ### Patch Changes
209
+
210
+ - @flink-app/flink@2.0.0-alpha.75
211
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.75
212
+
213
+ ## 2.0.0-alpha.74
214
+
215
+ ### Patch Changes
216
+
217
+ - Updated dependencies
218
+ - Updated dependencies
219
+ - @flink-app/flink@2.0.0-alpha.74
220
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.74
221
+
222
+ ## 2.0.0-alpha.73
223
+
224
+ ### Patch Changes
225
+
226
+ - Updated dependencies
227
+ - @flink-app/flink@2.0.0-alpha.73
228
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.73
229
+
230
+ ## 2.0.0-alpha.72
231
+
232
+ ### Patch Changes
233
+
234
+ - Updated dependencies
235
+ - @flink-app/flink@2.0.0-alpha.72
236
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.72
237
+
238
+ ## 2.0.0-alpha.71
239
+
240
+ ### Patch Changes
241
+
242
+ - @flink-app/flink@2.0.0-alpha.71
243
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.71
244
+
245
+ ## 2.0.0-alpha.70
246
+
247
+ ### Patch Changes
248
+
249
+ - @flink-app/flink@2.0.0-alpha.70
250
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.70
251
+
252
+ ## 2.0.0-alpha.69
253
+
254
+ ### Minor Changes
255
+
256
+ - feat(oidc-plugin): support public clients with PKCE-only authentication (no client secret)
257
+
258
+ `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.
259
+
260
+ ### Patch Changes
261
+
262
+ - @flink-app/flink@2.0.0-alpha.69
263
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.69
264
+
265
+ ## 2.0.0-alpha.68
266
+
267
+ ### Patch Changes
268
+
269
+ - @flink-app/flink@2.0.0-alpha.68
270
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.68
271
+
272
+ ## 2.0.0-alpha.67
273
+
274
+ ### Patch Changes
275
+
276
+ - Updated dependencies [418cb54]
277
+ - Updated dependencies [70d574c]
278
+ - @flink-app/flink@2.0.0-alpha.67
279
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.67
280
+
281
+ ## 2.0.0-alpha.66
282
+
283
+ ### Patch Changes
284
+
285
+ - Updated dependencies [5593d26]
286
+ - @flink-app/flink@2.0.0-alpha.66
287
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.66
288
+
289
+ ## 2.0.0-alpha.65
290
+
291
+ ### Patch Changes
292
+
293
+ - @flink-app/flink@2.0.0-alpha.65
294
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.65
295
+
296
+ ## 2.0.0-alpha.64
297
+
298
+ ### Patch Changes
299
+
300
+ - Updated dependencies [95b99ee]
301
+ - @flink-app/flink@2.0.0-alpha.64
302
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.64
303
+
304
+ ## 2.0.0-alpha.63
305
+
306
+ ### Patch Changes
307
+
308
+ - Updated dependencies [810df2c]
309
+ - Updated dependencies [8dd0752]
310
+ - @flink-app/flink@2.0.0-alpha.63
311
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.63
312
+
313
+ ## 2.0.0-alpha.62
314
+
315
+ ### Patch Changes
316
+
317
+ - Updated dependencies
318
+ - @flink-app/flink@2.0.0-alpha.62
319
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.62
320
+
321
+ ## 2.0.0-alpha.61
322
+
323
+ ### Patch Changes
324
+
325
+ - @flink-app/flink@2.0.0-alpha.61
326
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.61
327
+
328
+ ## 2.0.0-alpha.60
329
+
330
+ ### Patch Changes
331
+
332
+ - @flink-app/flink@2.0.0-alpha.60
333
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.60
334
+
335
+ ## 2.0.0-alpha.59
336
+
337
+ ### Patch Changes
338
+
339
+ - Updated dependencies [dbc2119]
340
+ - @flink-app/flink@2.0.0-alpha.59
341
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.59
342
+
343
+ ## 2.0.0-alpha.58
344
+
345
+ ### Patch Changes
346
+
347
+ - Updated dependencies
348
+ - @flink-app/flink@2.0.0-alpha.58
349
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.58
350
+
351
+ ## 2.0.0-alpha.57
352
+
353
+ ### Patch Changes
354
+
355
+ - Updated dependencies [ef7f495]
356
+ - Updated dependencies [2d53aa4]
357
+ - Updated dependencies [b3cc5d1]
358
+ - Updated dependencies [d377fac]
359
+ - Updated dependencies [4ad44c0]
360
+ - Updated dependencies [90f80c7]
361
+ - Updated dependencies [f0887e7]
362
+ - Updated dependencies [68c46d3]
363
+ - Updated dependencies [4ad44c0]
364
+ - Updated dependencies
365
+ - @flink-app/flink@2.0.0-alpha.57
366
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.57
367
+
368
+ ## 2.0.0-alpha.56
369
+
370
+ ### Patch Changes
371
+
372
+ - Zod 3.x compat
373
+ - Updated dependencies
374
+ - Updated dependencies [0203256]
375
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.56
376
+ - @flink-app/flink@2.0.0-alpha.56
377
+
378
+ ## 2.0.0-alpha.55
379
+
380
+ ### Patch Changes
381
+
382
+ - Updated dependencies [3267206]
383
+ - Updated dependencies [497b7c2]
384
+ - Updated dependencies [3267206]
385
+ - @flink-app/flink@2.0.0-alpha.55
386
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.55
387
+
388
+ ## 2.0.0-alpha.53
389
+
390
+ ### Patch Changes
391
+
392
+ - Updated dependencies [669c806]
393
+ - @flink-app/flink@2.0.0-alpha.53
394
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.53
395
+
396
+ ## 2.0.0-alpha.52
397
+
398
+ ### Patch Changes
399
+
400
+ - Updated dependencies [fe9f8f2]
401
+ - @flink-app/flink@2.0.0-alpha.52
402
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.52
403
+
404
+ ## 2.0.0-alpha.51
405
+
406
+ ### Patch Changes
407
+
408
+ - fix: add peerDependencies to all plugins and adapters
409
+
410
+ **Breaking Change Prevention:**
411
+
412
+ - Added "@flink-app/flink": ">=2.0.0-alpha.0" as peerDependency to all plugins
413
+ - Fixed oidc-plugin peerDependencies from "workspace:\*" to proper version ranges
414
+ - Fixed oauth-plugin to include @flink-app/flink peerDependency
415
+
416
+ **JWT Auth Plugin Interface Fix:**
417
+
418
+ - Removed redundant createToken declaration from JwtAuthPlugin interface
419
+ - The method is already inherited from FlinkAuthPlugin, this fixes TypeScript type checking issues
420
+
421
+ **Why this matters:**
422
+
423
+ - Ensures only one version of @flink-app/flink exists in node_modules
424
+ - Prevents type conflicts when TypeScript resolves interfaces across packages
425
+ - Follows standard plugin architecture best practices (same pattern as React, Webpack, etc.)
426
+ - Package managers now warn if incompatible versions are installed
427
+
428
+ - Updated dependencies
429
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.51
430
+ - @flink-app/flink@2.0.0-alpha.51
431
+
432
+ ## 2.0.0-alpha.50
433
+
434
+ ### Patch Changes
435
+
436
+ - Updated dependencies
437
+ - @flink-app/flink@2.0.0-alpha.50
438
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.50
439
+
440
+ ## 2.0.0-alpha.49
441
+
442
+ ### Patch Changes
443
+
444
+ - Typescript include fix
445
+ - Updated dependencies
446
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.49
447
+ - @flink-app/flink@2.0.0-alpha.49
448
+
449
+ ## 2.0.0-alpha.48
450
+
451
+ ### Patch Changes
452
+
453
+ - Updated dependencies
454
+ - @flink-app/jwt-auth-plugin@2.0.0-alpha.48
455
+ - @flink-app/flink@2.0.0-alpha.48
456
+
457
+ ## 1.0.0
458
+
459
+ ### Minor Changes
460
+
461
+ - Align minor version, from now all packages in monorepo will have same version
462
+
463
+ ### Patch Changes
464
+
465
+ - ee21c29: Normalize query parameters to predictable string types
466
+
467
+ Query parameters are now automatically normalized to `string | string[]` types before reaching handlers:
468
+
469
+ - Single values: converted to strings (e.g., `?page=1` → `{ page: "1" }`)
470
+ - Repeated parameters: converted to string arrays (e.g., `?tag=a&tag=b` → `{ tag: ["a", "b"] }`)
471
+ - All types (numbers, booleans, etc.) from Express parser are converted to strings
472
+
473
+ **Breaking Change (Minor):**
474
+
475
+ - `Query` type changed from `{ [x: string]: string | string[] | undefined }` to `Record<string, string | string[]>`
476
+ - `Params` type changed from `Request["params"]` to explicit `Record<string, string>`
477
+ - Removed `undefined` from query/param types since normalization ensures values are never undefined
478
+ - Updated OAuth and OIDC plugin query type definitions to satisfy new Query constraint
479
+
480
+ 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.
481
+
482
+ - Updated dependencies
483
+ - Updated dependencies [ee21c29]
484
+ - Updated dependencies [5c2ff97]
485
+ - @flink-app/flink@1.0.0
486
+ - @flink-app/jwt-auth-plugin@1.0.0
487
+
488
+ ## 0.14.3
489
+
490
+ ### Patch Changes
491
+
492
+ - Updated dependencies [52eba74]
493
+ - Updated dependencies [b37faa5]
494
+ - @flink-app/flink@0.14.3
495
+ - @flink-app/jwt-auth-plugin@0.14.1
496
+
497
+ ## 0.14.2
498
+
499
+ ### Patch Changes
500
+
501
+ - Updated dependencies [6d39832]
502
+ - @flink-app/flink@0.14.2
503
+ - @flink-app/jwt-auth-plugin@0.14.1
504
+
505
+ ## 0.14.1
506
+
507
+ ### Patch Changes
508
+
509
+ - fix: restore compatibility between core framework and plugins after 0.14.0 release
510
+
511
+ ## 1.0.0
512
+
513
+ ### Patch Changes
514
+
515
+ - Updated dependencies [7da5227]
516
+ - Updated dependencies [8ad040f]
517
+ - @flink-app/flink@0.14.0
518
+ - @flink-app/jwt-auth-plugin@0.13.1
519
+
520
+ ## 0.13.5
521
+
522
+ ### Patch Changes
523
+
524
+ - Updated dependencies
525
+ - @flink-app/flink@0.13.5
526
+ - @flink-app/jwt-auth-plugin@0.13.1
527
+
528
+ ## 0.13.4
529
+
530
+ ### Patch Changes
531
+
532
+ - Updated dependencies
533
+ - @flink-app/flink@0.13.4
534
+ - @flink-app/jwt-auth-plugin@0.13.1
535
+
536
+ ## 0.13.3
537
+
538
+ ### Patch Changes
539
+
540
+ - Updated dependencies
541
+ - @flink-app/flink@0.13.3
542
+ - @flink-app/jwt-auth-plugin@0.13.1
543
+
544
+ ## 0.13.2
545
+
546
+ ### Patch Changes
547
+
548
+ - Updated dependencies
549
+ - @flink-app/flink@0.13.2
550
+ - @flink-app/jwt-auth-plugin@0.13.1
551
+
552
+ ## 0.13.1
553
+
554
+ ### Patch Changes
555
+
556
+ - Fixed invalid types and improve typescript error message during schema compilation
557
+ - Updated dependencies
558
+ - @flink-app/jwt-auth-plugin@0.13.1
559
+ - @flink-app/flink@0.13.1
560
+
3
561
  ## 1.0.0
4
562
 
5
563
  ### 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"}