@owlmeans/web-oidc-provider 0.1.2 → 0.1.3

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 (3) hide show
  1. package/README.md +27 -648
  2. package/package.json +8 -7
  3. package/tsconfig.json +6 -11
package/README.md CHANGED
@@ -1,677 +1,56 @@
1
1
  # @owlmeans/web-oidc-provider
2
2
 
3
- Web-based OpenID Connect Provider functionality for OwlMeans Common Libraries. This package provides client-side authentication state management and interaction handling for OIDC Provider implementations, designed for React-based web applications with secure authentication flows.
3
+ Browser-side state for an embedded OIDC provider's interaction screens (login, consent).
4
4
 
5
- ## Overview
6
-
7
- The `@owlmeans/web-oidc-provider` package serves as the web frontend component for OIDC Provider functionality in the OwlMeans ecosystem. It handles client-side authentication state management, interaction flows, and cookie-based session management. This package is designed for fullstack applications with focus on security and proper OIDC authentication flows.
5
+ > Use this package only when your app hosts the OIDC provider screens. For relying-party usage in a web app, use [`@owlmeans/web-oidc-rp`](../web-oidc-rp) instead.
8
6
 
9
- **Key Features:**
10
- - **Authentication State Management**: Client-side OIDC authentication state tracking and validation
11
- - **Interaction Handling**: OIDC interaction flow management with session persistence
12
- - **Cookie Management**: Secure cookie-based session and interaction tracking
13
- - **Multi-Entity Support**: Support for multiple entity authentication within the same session
14
- - **DID Integration**: Decentralized Identity (DID) linking and validation
15
- - **Stack-based Sessions**: Session stacking for complex authentication flows
7
+ ## Overview
16
8
 
17
- This package follows the OwlMeans "quadra" pattern as the **web** implementation, complementing:
18
- - **@owlmeans/oidc**: Common OIDC declarations and base functionality *(base package)*
19
- - **@owlmeans/server-oidc-provider**: Server-side OIDC provider implementation
20
- - **@owlmeans/web-oidc-provider**: Web client OIDC provider integration *(this package)*
21
- - **@owlmeans/web-oidc-rp**: Web client OIDC Relying Party implementation
9
+ - `makeAuthStateModel(...)` factory for the OIDC interaction state model
10
+ - `OidcAuthState` enum `Authenticated`, `SameEntity`, `IdLinked`, `ProfileExists`, `RegistrationAllowed`, `Simplified`
11
+ - Types describing the provider UI state
22
12
 
23
13
  ## Installation
24
14
 
25
15
  ```bash
26
- npm install @owlmeans/web-oidc-provider
27
- ```
28
-
29
- ## Dependencies
30
-
31
- This package requires and integrates with:
32
- - `@owlmeans/oidc`: Core OIDC functionality and shared configuration
33
- - `@owlmeans/auth`: Authentication system and types
34
- - `@owlmeans/resource`: Resource management for interaction storage
35
- - `@owlmeans/web-client`: Web client framework and context
36
- - `universal-cookie`: Cookie management for cross-browser compatibility
37
- - React: Peer dependency for web components
38
-
39
- ## Key Concepts
40
-
41
- ### OIDC Authentication States
42
-
43
- The package manages various authentication states throughout the OIDC flow:
44
-
45
- - **Authenticated**: User has valid authentication credentials
46
- - **SameEntity**: Current user belongs to the same entity as the OIDC interaction
47
- - **IdLinked**: User has a linked Decentralized Identity (DID)
48
- - **ProfileExists**: User profile exists in the system
49
- - **RegistrationAllowed**: New user registration is permitted
50
-
51
- ### Interaction Management
52
-
53
- OIDC interactions are managed with:
54
- - **Session Persistence**: Interactions persist across browser sessions via cookies
55
- - **Stack-based Flow**: Support for nested authentication flows and entity switching
56
- - **State Validation**: Continuous validation of authentication state
57
- - **Secure Storage**: Encrypted storage of interaction data via OwlMeans resource system
58
-
59
- ### Cookie-based Session Management
60
-
61
- Secure session management using:
62
- - **Interaction Cookies**: Track current OIDC interaction sessions
63
- - **Configurable TTL**: Adjustable session timeouts and expiration
64
- - **Cross-domain Support**: Support for multi-domain OIDC flows
65
- - **Secure Settings**: HttpOnly and Secure cookie flags for production environments
66
-
67
- ## API Reference
68
-
69
- ### Factory Functions
70
-
71
- #### `makeAuthStateModel<C, T>(context, updateState): OidcAuthStateModel`
72
-
73
- Creates an OIDC authentication state model for managing client-side authentication flow.
74
-
75
- ```typescript
76
- import { makeAuthStateModel } from '@owlmeans/web-oidc-provider'
77
- import { makeWebContext } from '@owlmeans/web-client'
78
-
79
- const context = makeWebContext(config)
80
-
81
- const authStateModel = makeAuthStateModel(context, async (uid: string) => {
82
- // Update authentication state from server
83
- const response = await fetch(`/api/oidc/auth-state/${uid}`)
84
- return response.json()
85
- })
16
+ bun add @owlmeans/web-oidc-provider
86
17
  ```
87
18
 
88
- **Parameters:**
89
- - `context`: `AppContext<C>` - Web application context
90
- - `updateState`: `(uid: string) => Promise<{entityId?: string, did?: string}>` - Function to update authentication state from server
91
-
92
- **Returns:** `OidcAuthStateModel` - Authentication state model instance
93
-
94
- ### Core Interfaces
95
-
96
- #### `OidcAuthStateModel`
97
-
98
- Main interface for managing OIDC authentication state on the client side.
19
+ ## Usage
99
20
 
100
21
  ```typescript
101
- interface OidcAuthStateModel extends AuthStateProperties {
102
- // Initialization and state management
103
- init: (uid: string, reset?: boolean) => Promise<OidcAuthStateModel>
104
- updateAuthState: (uid: string) => Promise<OidcAuthState[]>
105
-
106
- // State validation methods
107
- isAuthenticated: () => boolean
108
- isSameEntity: () => boolean
109
- isIdLinked: () => boolean
110
- profileExists: () => boolean
111
- isRegistrationAllowed: () => boolean
112
-
113
- // Interaction management
114
- finishInteraction: (skipState?: boolean) => Promise<void>
115
- getState: () => OidcAuthState[]
116
- }
117
- ```
118
-
119
- **Methods:**
120
-
121
- **`init(uid: string, reset?: boolean): Promise<OidcAuthStateModel>`**
122
- - **Purpose**: Initialize the authentication state model for a specific interaction
123
- - **Parameters**:
124
- - `uid`: Unique interaction identifier
125
- - `reset`: Optional flag to reset existing interaction stack
126
- - **Behavior**:
127
- - Loads existing state from cache or creates new state
128
- - Manages interaction stack for nested flows
129
- - Sets interaction cookies with appropriate TTL
130
- - **Returns**: Promise resolving to the initialized model
131
- - **Throws**: `SyntaxError` if no valid UID is provided
132
-
133
- **`updateAuthState(uid: string): Promise<OidcAuthState[]>`**
134
- - **Purpose**: Update authentication state by querying server and validating current session
135
- - **Parameters**: `uid` - Interaction identifier
136
- - **Behavior**:
137
- - Calls server to get updated authentication status
138
- - Validates current user against interaction entity
139
- - Updates DID linking status
140
- - Caches updated state
141
- - **Returns**: Promise resolving to array of current authentication states
142
-
143
- **`isAuthenticated(): boolean`**
144
- - **Purpose**: Check if user is currently authenticated
145
- - **Returns**: `true` if user has valid authentication
146
-
147
- **`isSameEntity(): boolean`**
148
- - **Purpose**: Check if authenticated user belongs to the same entity as the OIDC interaction
149
- - **Returns**: `true` if user entity matches interaction entity
150
-
151
- **`isIdLinked(): boolean`**
152
- - **Purpose**: Check if user has a linked Decentralized Identity (DID)
153
- - **Returns**: `true` if DID is linked to user account
154
-
155
- **`profileExists(): boolean`**
156
- - **Purpose**: Check if user profile exists in the system
157
- - **Returns**: `true` if user profile is available
158
-
159
- **`isRegistrationAllowed(): boolean`**
160
- - **Purpose**: Check if new user registration is permitted
161
- - **Returns**: `true` if registration is allowed
162
-
163
- **`finishInteraction(skipState?: boolean): Promise<void>`**
164
- - **Purpose**: Complete current interaction and restore previous session from stack
165
- - **Parameters**: `skipState` - Optional flag to skip state update
166
- - **Behavior**:
167
- - Removes current interaction from cache
168
- - Pops previous interaction from stack
169
- - Updates cookies to previous session
170
- - Optionally updates authentication state
171
-
172
- **`getState(): OidcAuthState[]`**
173
- - **Purpose**: Get current authentication states as array
174
- - **Returns**: Array of active authentication state flags
175
-
176
- #### `AuthStateProperties`
177
-
178
- Properties maintained by the authentication state model.
179
-
180
- ```typescript
181
- interface AuthStateProperties {
182
- did?: string // Decentralized Identity identifier
183
- entityId?: string // Entity identifier for multi-tenant support
184
- state: Set<OidcAuthState> // Set of current authentication states
185
- uid: string // Unique interaction identifier
186
- }
187
- ```
188
-
189
- #### `OidcInteraction`
190
-
191
- Resource record for persisting interaction state across sessions.
192
-
193
- ```typescript
194
- interface OidcInteraction extends ResourceRecord {
195
- stack: Array<{
196
- token: string | null // Previous session authentication token
197
- uid: string // Previous interaction identifier
198
- }>
199
- }
200
- ```
201
-
202
- #### `WithSharedConfig`
203
-
204
- Configuration interface for OIDC provider settings.
205
-
206
- ```typescript
207
- interface WithSharedConfig {
208
- oidc: OidcSharedConfig
209
- }
210
- ```
211
-
212
- ### Enums
213
-
214
- #### `OidcAuthState`
215
-
216
- Enumeration of possible authentication states during OIDC flows.
217
-
218
- ```typescript
219
- enum OidcAuthState {
220
- Authenticated = 'authenticated', // User is authenticated
221
- SameEntity = 'same-entity', // User belongs to interaction entity
222
- IdLinked = 'id-linked', // DID is linked to user
223
- ProfileExists = 'profile-exists', // User profile exists
224
- RegistrationAllowed = 'registration-allowed' // Registration permitted
225
- }
226
- ```
227
-
228
- ## Usage Examples
229
-
230
- ### Basic OIDC Provider Integration
231
-
232
- ```typescript
233
- import { makeAuthStateModel } from '@owlmeans/web-oidc-provider'
234
- import { makeWebContext } from '@owlmeans/web-client'
235
-
236
- // Configure web context with OIDC settings
237
- const config = {
238
- service: 'oidc-provider',
239
- oidc: {
240
- clientCookie: {
241
- interaction: {
242
- name: '_oidc_interaction',
243
- ttl: 3600 // 1 hour
244
- }
245
- }
246
- }
247
- }
248
-
249
- const context = makeWebContext(config)
250
-
251
- // Create authentication state model
252
- const authState = makeAuthStateModel(context, async (uid) => {
253
- // Fetch authentication state from server
254
- const response = await fetch(`/api/oidc/interaction/${uid}/state`, {
255
- credentials: 'include'
256
- })
257
-
258
- if (!response.ok) {
259
- throw new Error('Failed to fetch authentication state')
260
- }
261
-
262
- return response.json()
263
- })
264
-
265
- // Initialize for specific interaction
266
- await authState.init(interactionId)
267
- ```
268
-
269
- ### OIDC Authentication Flow Management
270
-
271
- ```typescript
272
- // Handle OIDC authentication flow
273
- const handleOidcFlow = async (interactionId: string) => {
274
- try {
275
- // Initialize authentication state
276
- await authState.init(interactionId)
277
-
278
- // Check current authentication status
279
- if (authState.isAuthenticated()) {
280
- if (authState.isSameEntity()) {
281
- // User is authenticated and belongs to correct entity
282
- console.log('User authenticated for correct entity')
283
-
284
- if (authState.isIdLinked()) {
285
- console.log('DID is linked to user account')
286
- }
287
-
288
- // Proceed with OIDC authorization
289
- await proceedWithAuthorization()
290
- } else {
291
- // User authenticated but for different entity
292
- console.log('User needs to switch entities or re-authenticate')
293
- await promptEntitySwitch()
294
- }
295
- } else {
296
- // User not authenticated
297
- if (authState.isRegistrationAllowed()) {
298
- console.log('User can register or login')
299
- await showLoginOrRegisterForm()
300
- } else {
301
- console.log('Registration not allowed, login required')
302
- await showLoginForm()
303
- }
304
- }
305
- } catch (error) {
306
- console.error('OIDC flow error:', error)
307
- await handleAuthenticationError(error)
308
- }
309
- }
310
-
311
- const proceedWithAuthorization = async () => {
312
- // Continue with OIDC authorization grant
313
- const states = authState.getState()
314
- console.log('Current states:', states)
315
-
316
- // Make authorization decision based on current state
317
- window.location.href = '/oidc/auth/consent'
318
- }
319
-
320
- const showLoginForm = async () => {
321
- // Display login form component
322
- // After successful login, update authentication state
323
- await authState.updateAuthState(authState.uid)
324
- }
325
- ```
326
-
327
- ### Multi-Entity Authentication
328
-
329
- ```typescript
330
- // Handle entity switching in OIDC flows
331
- const handleEntitySwitch = async (newEntityId: string) => {
332
- try {
333
- // Store current interaction in stack
334
- await authState.init(newEntityId, false) // Don't reset stack
335
-
336
- // Check if user is already authenticated for new entity
337
- if (authState.isAuthenticated() && authState.isSameEntity()) {
338
- console.log('User already authenticated for target entity')
339
- return true
340
- }
341
-
342
- // Redirect to authentication for new entity
343
- window.location.href = `/auth/entity/${newEntityId}`
344
-
345
- } catch (error) {
346
- console.error('Entity switch error:', error)
347
- return false
348
- }
349
- }
350
-
351
- // Complete interaction and return to previous session
352
- const completeInteraction = async () => {
353
- try {
354
- await authState.finishInteraction()
355
- console.log('Returned to previous interaction:', authState.uid)
356
-
357
- // Redirect to original application
358
- window.location.href = '/dashboard'
359
- } catch (error) {
360
- console.error('Failed to complete interaction:', error)
361
- }
362
- }
363
- ```
364
-
365
- ### DID Integration
366
-
367
- ```typescript
368
- // Handle Decentralized Identity linking
369
- const handleDidLinking = async (didDocument: any) => {
370
- try {
371
- // Link DID to user account
372
- const response = await fetch('/api/did/link', {
373
- method: 'POST',
374
- headers: { 'Content-Type': 'application/json' },
375
- credentials: 'include',
376
- body: JSON.stringify({
377
- did: didDocument.id,
378
- interactionId: authState.uid
379
- })
380
- })
381
-
382
- if (response.ok) {
383
- // Update authentication state to reflect DID linking
384
- await authState.updateAuthState(authState.uid)
385
-
386
- if (authState.isIdLinked()) {
387
- console.log('DID successfully linked')
388
- return true
389
- }
390
- }
391
-
392
- throw new Error('DID linking failed')
393
- } catch (error) {
394
- console.error('DID linking error:', error)
395
- return false
396
- }
397
- }
398
-
399
- // Verify DID authentication
400
- const verifyDidAuth = async (signature: string, challenge: string) => {
401
- if (!authState.isIdLinked()) {
402
- throw new Error('DID not linked to account')
403
- }
404
-
405
- // Verify DID signature with server
406
- const response = await fetch('/api/did/verify', {
407
- method: 'POST',
408
- headers: { 'Content-Type': 'application/json' },
409
- credentials: 'include',
410
- body: JSON.stringify({
411
- signature,
412
- challenge,
413
- interactionId: authState.uid
414
- })
415
- })
416
-
417
- return response.ok
418
- }
419
- ```
420
-
421
- ### React Component Integration
422
-
423
- ```typescript
424
- import React, { useEffect, useState } from 'react'
425
22
  import { makeAuthStateModel, OidcAuthState } from '@owlmeans/web-oidc-provider'
426
23
 
427
- interface OidcProviderProps {
428
- interactionId: string
429
- onStateChange?: (states: OidcAuthState[]) => void
430
- }
431
-
432
- const OidcProvider: React.FC<OidcProviderProps> = ({
433
- interactionId,
434
- onStateChange
435
- }) => {
436
- const [authState, setAuthState] = useState<any>(null)
437
- const [currentStates, setCurrentStates] = useState<OidcAuthState[]>([])
438
- const [loading, setLoading] = useState(true)
439
- const [error, setError] = useState<string | null>(null)
440
-
441
- useEffect(() => {
442
- const initializeAuth = async () => {
443
- try {
444
- setLoading(true)
445
-
446
- const model = makeAuthStateModel(context, async (uid) => {
447
- // Fetch state from server
448
- const response = await fetch(`/api/oidc/state/${uid}`)
449
- return response.json()
450
- })
451
-
452
- await model.init(interactionId)
453
- const states = model.getState()
454
-
455
- setAuthState(model)
456
- setCurrentStates(states)
457
- onStateChange?.(states)
458
- } catch (err) {
459
- setError(err.message)
460
- } finally {
461
- setLoading(false)
462
- }
463
- }
464
-
465
- initializeAuth()
466
- }, [interactionId])
467
-
468
- const handleLogin = async (credentials: any) => {
469
- try {
470
- // Perform login
471
- await performLogin(credentials)
472
-
473
- // Update authentication state
474
- const states = await authState.updateAuthState(interactionId)
475
- setCurrentStates(states)
476
- onStateChange?.(states)
477
- } catch (err) {
478
- setError(err.message)
479
- }
480
- }
481
-
482
- const handleComplete = async () => {
483
- try {
484
- await authState.finishInteraction()
485
- // Redirect or update UI
486
- } catch (err) {
487
- setError(err.message)
488
- }
489
- }
490
-
491
- if (loading) return <div>Loading authentication...</div>
492
- if (error) return <div>Error: {error}</div>
24
+ const stateModel = makeAuthStateModel<C, T>(context, /* options */)
493
25
 
494
- return (
495
- <div className="oidc-provider">
496
- <div className="auth-status">
497
- <h3>Authentication Status</h3>
498
- <ul>
499
- {currentStates.map(state => (
500
- <li key={state}>{state}</li>
501
- ))}
502
- </ul>
503
- </div>
504
-
505
- {!authState.isAuthenticated() && (
506
- <LoginForm onLogin={handleLogin} />
507
- )}
508
-
509
- {authState.isAuthenticated() && authState.isSameEntity() && (
510
- <ConsentForm onConsent={handleComplete} />
511
- )}
512
-
513
- {authState.isAuthenticated() && !authState.isSameEntity() && (
514
- <EntitySwitchForm onSwitch={handleEntitySwitch} />
515
- )}
516
- </div>
517
- )
26
+ if (stateModel.state === OidcAuthState.Simplified) {
27
+ // render simplified login screen
518
28
  }
519
29
  ```
520
30
 
521
- ## Configuration
31
+ This package pairs with [`@owlmeans/server-oidc-provider`](../server-oidc-provider): the server hosts the OIDC endpoints, and this package drives the browser-rendered interaction screens.
522
32
 
523
- ### OIDC Provider Configuration
33
+ ## API
524
34
 
525
- ```typescript
526
- interface OidcProviderConfig {
527
- oidc: {
528
- clientCookie: {
529
- interaction: {
530
- name: string // Cookie name for interaction tracking
531
- ttl: number // Time to live in seconds
532
- }
533
- }
534
- provider: {
535
- issuer: string // OIDC provider issuer URL
536
- clientId: string // OAuth2 client identifier
537
- redirectUri: string // Redirect URI after authentication
538
- }
539
- }
540
- defaultEntityId?: string // Default entity for multi-tenant scenarios
541
- }
542
- ```
543
-
544
- ### Cookie Security Settings
545
-
546
- ```typescript
547
- // Production cookie settings
548
- const productionCookieConfig = {
549
- secure: true, // Require HTTPS
550
- httpOnly: true, // Prevent XSS access
551
- sameSite: 'strict', // CSRF protection
552
- domain: '.example.com', // Cross-subdomain access
553
- path: '/' // Site-wide access
554
- }
555
- ```
556
-
557
- ## Error Handling
35
+ ### `makeAuthStateModel<C, T>(context, ...)`
558
36
 
559
- ### Common Error Scenarios
37
+ Creates the auth-state model used by the interaction UI. Reads the current interaction context and exposes typed state transitions.
560
38
 
561
- ```typescript
562
- // Handle authentication state errors
563
- const handleAuthErrors = async (error: Error) => {
564
- switch (error.message) {
565
- case 'no-uid':
566
- console.error('No interaction UID provided')
567
- // Redirect to OIDC entry point
568
- window.location.href = '/oidc/auth'
569
- break
570
-
571
- case 'invalid-interaction':
572
- console.error('Invalid or expired interaction')
573
- // Clear cookies and restart flow
574
- await clearInteractionCookies()
575
- window.location.href = '/oidc/auth'
576
- break
577
-
578
- case 'entity-mismatch':
579
- console.error('User entity does not match interaction')
580
- // Prompt for entity switch or re-authentication
581
- await promptEntitySwitch()
582
- break
583
-
584
- default:
585
- console.error('Authentication error:', error)
586
- // Show generic error message
587
- showErrorMessage('Authentication failed. Please try again.')
588
- }
589
- }
590
-
591
- // Cleanup after errors
592
- const clearInteractionCookies = async () => {
593
- const cookies = new Cookies()
594
- cookies.remove('_oidc_interaction', { path: '/' })
595
-
596
- // Clear cached state
597
- await authState.finishInteraction(true)
598
- }
599
- ```
39
+ ### `OidcAuthState` enum
600
40
 
601
- ## Security Considerations
41
+ - `Authenticated` — `'authenticated'`
42
+ - `SameEntity` — `'same-entity'`
43
+ - `IdLinked` — `'id-linked'`
44
+ - `ProfileExists` — `'profile-exists'`
45
+ - `RegistrationAllowed` — `'registration-allowed'`
46
+ - `Simplified` — `'simplified'`
602
47
 
603
- ### Cookie Security
604
- - **Secure Flags**: Always use `Secure` and `HttpOnly` flags in production
605
- - **SameSite Protection**: Configure `SameSite` attribute for CSRF protection
606
- - **TTL Management**: Implement appropriate session timeouts
48
+ ### Types
607
49
 
608
- ### State Validation
609
- - **Server Verification**: Always verify authentication state with server
610
- - **Entity Validation**: Validate user entity matches interaction requirements
611
- - **DID Verification**: Verify DID signatures using cryptographic validation
612
-
613
- ### Session Management
614
- - **Stack Protection**: Limit interaction stack depth to prevent abuse
615
- - **Cache Security**: Secure in-memory state cache with appropriate cleanup
616
- - **Token Handling**: Secure handling of authentication tokens in stacked sessions
617
-
618
- ## Integration with OwlMeans Ecosystem
619
-
620
- ### Context Integration
621
- ```typescript
622
- import { makeWebContext } from '@owlmeans/web-client'
623
-
624
- const context = makeWebContext(config)
625
- const authService = context.auth()
626
- ```
627
-
628
- ### Resource System Integration
629
- ```typescript
630
- import { useStoreModel } from '@owlmeans/web-client'
631
-
632
- // Persistent interaction storage
633
- const interactionStore = useStoreModel<OidcInteraction>('oidc-interactions')
634
- ```
635
-
636
- ### Authentication System Integration
637
- ```typescript
638
- import type { Auth } from '@owlmeans/auth'
639
-
640
- // Validate against OwlMeans auth system
641
- const currentUser: Auth = context.auth().user()
642
- const isAuthenticated = await context.auth().authenticated()
643
- ```
644
-
645
- ## Best Practices
646
-
647
- 1. **State Synchronization**: Always synchronize client state with server state
648
- 2. **Error Recovery**: Implement robust error recovery mechanisms
649
- 3. **Security**: Use secure cookie settings and validate all state transitions
650
- 4. **Performance**: Cache authentication state appropriately with proper TTL
651
- 5. **User Experience**: Provide clear feedback during authentication flows
652
- 6. **Multi-Entity**: Handle entity switching gracefully in multi-tenant scenarios
50
+ Provider UI state and option types — exported from the root entry.
653
51
 
654
52
  ## Related Packages
655
53
 
656
- - **@owlmeans/oidc**: Core OIDC functionality and shared configuration
657
- - **@owlmeans/server-oidc-provider**: Server-side OIDC provider implementation
658
- - **@owlmeans/web-oidc-rp**: Web OIDC Relying Party implementation
659
- - **@owlmeans/auth**: Core authentication system
660
- - **@owlmeans/web-client**: Web client framework and context
661
- - **@owlmeans/resource**: Resource management for state persistence
662
-
663
- ## TypeScript Support
664
-
665
- This package is written in TypeScript and provides full type safety:
666
-
667
- ```typescript
668
- import type {
669
- OidcAuthStateModel,
670
- OidcAuthState,
671
- OidcInteraction,
672
- WithSharedConfig
673
- } from '@owlmeans/web-oidc-provider'
674
-
675
- const authState: OidcAuthStateModel = makeAuthStateModel(context, updateFunction)
676
- const states: OidcAuthState[] = authState.getState()
677
- ```
54
+ - [`@owlmeans/server-oidc-provider`](../server-oidc-provider) server hosting OIDC endpoints and interactions
55
+ - [`@owlmeans/oidc`](../oidc) shared `INTERACTION` constants and types
56
+ - [`@owlmeans/web-client`](../web-client) / [`@owlmeans/web-panel`](../web-panel) web context this UI runs in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/web-oidc-provider",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -21,21 +21,22 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@owlmeans/auth": "^0.1.2",
25
- "@owlmeans/client-flow": "^0.1.2",
26
- "@owlmeans/oidc": "^0.1.2",
27
- "@owlmeans/resource": "^0.1.2",
28
- "@owlmeans/web-client": "^0.1.2",
24
+ "@owlmeans/auth": "^0.1.3",
25
+ "@owlmeans/client-flow": "^0.1.3",
26
+ "@owlmeans/oidc": "^0.1.3",
27
+ "@owlmeans/resource": "^0.1.3",
28
+ "@owlmeans/web-client": "^0.1.3",
29
29
  "universal-cookie": "^7.2.1"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": "*"
33
33
  },
34
34
  "devDependencies": {
35
+ "@owlmeans/dep-config": "workspace:*",
35
36
  "@types/react": "^19.2.7",
36
37
  "nodemon": "^3.1.11",
37
38
  "npm-check": "^6.0.1",
38
- "typescript": "^5.8.3"
39
+ "typescript": "^6.0.2"
39
40
  },
40
41
  "publishConfig": {
41
42
  "access": "public"
package/tsconfig.json CHANGED
@@ -1,16 +1,11 @@
1
1
  {
2
2
  "extends": [
3
- "../tsconfig.default.json",
4
- "../tsconfig.react.json",
3
+ "@owlmeans/dep-config/tsconfig.base.json",
4
+ "@owlmeans/dep-config/tsconfig.react.json"
5
5
  ],
6
6
  "compilerOptions": {
7
- "rootDir": "./src/", /* Specify the root folder within your source files. */
8
- "outDir": "./build/", /* Specify an output folder for all emitted files. */
9
- "moduleResolution": "Bundler",
7
+ "rootDir": "./src/",
8
+ "outDir": "./build/"
10
9
  },
11
- "exclude": [
12
- "./dist/**/*",
13
- "./build/**/*",
14
- "./*.ts"
15
- ]
16
- }
10
+ "exclude": ["./dist/**/*", "./build/**/*", "./*.ts"]
11
+ }