@memberjunction/ng-auth-services 6.2.0-edge.0 → 6.2.0-edge.2
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/dist/lib/AngularAuthProviderFactory.d.ts +12 -0
- package/dist/lib/AngularAuthProviderFactory.d.ts.map +1 -1
- package/dist/lib/AngularAuthProviderFactory.js +31 -7
- package/dist/lib/AngularAuthProviderFactory.js.map +1 -1
- package/dist/lib/IAuthProvider.js.map +1 -1
- package/dist/lib/auth-services.module.d.ts +2 -0
- package/dist/lib/auth-services.module.d.ts.map +1 -1
- package/dist/lib/auth-services.module.js +7 -3
- package/dist/lib/auth-services.module.js.map +1 -1
- package/dist/lib/catalog-environment.d.ts +4 -0
- package/dist/lib/catalog-environment.d.ts.map +1 -1
- package/dist/lib/catalog-environment.js +11 -3
- package/dist/lib/catalog-environment.js.map +1 -1
- package/dist/lib/providers/mjexplorer-auth0-provider.service.d.ts +11 -3
- package/dist/lib/providers/mjexplorer-auth0-provider.service.d.ts.map +1 -1
- package/dist/lib/providers/mjexplorer-auth0-provider.service.js +32 -16
- package/dist/lib/providers/mjexplorer-auth0-provider.service.js.map +1 -1
- package/dist/lib/providers/mjexplorer-cognito-provider.service.d.ts +11 -1
- package/dist/lib/providers/mjexplorer-cognito-provider.service.d.ts.map +1 -1
- package/dist/lib/providers/mjexplorer-cognito-provider.service.js +9 -1
- package/dist/lib/providers/mjexplorer-cognito-provider.service.js.map +1 -1
- package/dist/lib/providers/mjexplorer-magic-link-provider.service.d.ts +2 -0
- package/dist/lib/providers/mjexplorer-magic-link-provider.service.d.ts.map +1 -1
- package/dist/lib/providers/mjexplorer-magic-link-provider.service.js +5 -1
- package/dist/lib/providers/mjexplorer-magic-link-provider.service.js.map +1 -1
- package/dist/lib/providers/mjexplorer-msal-provider.service.d.ts +49 -3
- package/dist/lib/providers/mjexplorer-msal-provider.service.d.ts.map +1 -1
- package/dist/lib/providers/mjexplorer-msal-provider.service.js +41 -25
- package/dist/lib/providers/mjexplorer-msal-provider.service.js.map +1 -1
- package/dist/lib/providers/mjexplorer-okta-provider.service.d.ts +23 -1
- package/dist/lib/providers/mjexplorer-okta-provider.service.d.ts.map +1 -1
- package/dist/lib/providers/mjexplorer-okta-provider.service.js +9 -1
- package/dist/lib/providers/mjexplorer-okta-provider.service.js.map +1 -1
- package/dist/lib/providers/mjexplorer-workos-provider.service.d.ts +21 -1
- package/dist/lib/providers/mjexplorer-workos-provider.service.d.ts.map +1 -1
- package/dist/lib/providers/mjexplorer-workos-provider.service.js +9 -1
- package/dist/lib/providers/mjexplorer-workos-provider.service.js.map +1 -1
- package/dist/lib/redirect.component.d.ts +5 -1
- package/dist/lib/redirect.component.d.ts.map +1 -1
- package/dist/lib/redirect.component.js +11 -3
- package/dist/lib/redirect.component.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mjexplorer-okta-provider.service.js","sourceRoot":"","sources":["../../../src/lib/providers/mjexplorer-okta-provider.service.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,OAAO,QAAmD,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAIL,aAAa,EAEd,MAAM,eAAe,CAAC;;AACvB;;;;;;GAMG;AAKI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;;IAuBF;IAtB1C,MAAM,CAAU,aAAa,GAAG,MAAM,CAAC;IAC9B,IAAI,GAAG,gBAAc,CAAC,aAAa,CAAC;IACrC,QAAQ,CAAW;IACnB,YAAY,GAAG,KAAK,CAAC;IAE7B;;;OAGG;IACH,MAAM,CAAC,sBAAsB,GAAG,CAAC,WAAoC,EAAE,EAAE,CAAC;QACxE;YACE,OAAO,EA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AC;IAChC,CAAC;IAEQ,cAAc,CAAC,MAA+B;QACrD,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;wGAtgBU,cAAc,cAuBL,YAAY;gEAvBrB,cAAc,WAAd,cAAc,mBAHb,MAAM;;AAGP,cAAc;IAD1B,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC;GACrB,cAAc,CAugB1B;;iFAvgBY,cAAc;cAJ1B,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;sBAyBc,MAAM;uBAAC,YAAY","sourcesContent":["import { Injectable, Inject } from '@angular/core';\nimport { RegisterClass } from '@memberjunction/global';\nimport { Observable, BehaviorSubject, from } from 'rxjs';\nimport { MJAuthBase } from '../mjexplorer-auth-base.service';\nimport { AngularAuthProviderConfig } from '../IAuthProvider';\nimport OktaAuth, { OktaAuthOptions, IDToken, AccessToken } from '@okta/okta-auth-js';\nimport {\n StandardUserInfo,\n StandardAuthToken,\n StandardAuthError,\n AuthErrorType,\n TokenRefreshResult\n} from '../auth-types';\n/**\n * Okta authentication provider implementation - v3.0.0\n *\n * Implements the abstract methods from MJAuthBase to hide Okta-specific details.\n * The key abstraction is that Okta stores the JWT in IDToken.idToken,\n * but consumers never need to know this detail.\n */\n@Injectable({\n providedIn: 'root'\n})\n@RegisterClass(MJAuthBase, 'okta')\nexport class MJOktaProvider extends MJAuthBase {\n static readonly PROVIDER_TYPE = 'okta';\n readonly type = MJOktaProvider.PROVIDER_TYPE;\n private oktaAuth: OktaAuth;\n private isRefreshing = false;\n\n /**\n * Factory function to provide Angular dependencies required by Okta\n * Stored as a static property for the factory to access without instantiation\n */\n static angularProviderFactory = (environment: Record<string, unknown>) => [\n {\n provide: 'oktaConfig',\n useValue: {\n clientId: environment['OKTA_CLIENTID'],\n domain: environment['OKTA_DOMAIN'],\n issuer: environment['OKTA_ISSUER'] || `https://${environment['OKTA_DOMAIN']}/oauth2/default`,\n redirectUri: environment['OKTA_REDIRECT_URI'] || window.location.origin,\n scopes: environment['OKTA_SCOPES'] || ['openid', 'profile', 'email']\n }\n }\n ];\n\n constructor(@Inject('oktaConfig') private oktaConfig: OktaAuthOptions & { domain?: string }) {\n const config: AngularAuthProviderConfig = {\n name: MJOktaProvider.PROVIDER_TYPE,\n type: MJOktaProvider.PROVIDER_TYPE\n };\n super(config);\n\n // Build configuration with defaults\n const oktaAuthConfig: OktaAuthOptions = {\n clientId: this.oktaConfig.clientId,\n redirectUri: this.oktaConfig.redirectUri || window.location.origin + '/callback',\n scopes: this.oktaConfig.scopes || ['openid', 'profile', 'email'],\n pkce: true, // Use PKCE for security\n ...this.oktaConfig,\n // Set issuer after spread to ensure it's not overwritten if not present in config\n issuer: this.oktaConfig.issuer || (this.oktaConfig.domain ? `https://${this.oktaConfig.domain}/oauth2/default` : '')\n };\n\n this.oktaAuth = new OktaAuth(oktaAuthConfig);\n\n // Listen for token events\n this.oktaAuth.authStateManager.subscribe((authState: unknown) => {\n const state = authState as { isAuthenticated?: boolean; idToken?: IDToken };\n this.updateAuthState(state.isAuthenticated || false);\n\n // Don't update user info if we're in the middle of a refresh\n if (!this.isRefreshing) {\n if (state.isAuthenticated && state.idToken) {\n const userInfo = this.mapOktaTokenToStandard(state.idToken);\n this.updateUserInfo(userInfo);\n } else {\n this.updateUserInfo(null);\n }\n }\n });\n }\n\n // ============================================================================\n // LIFECYCLE METHODS\n // ============================================================================\n\n async initialize(): Promise<void> {\n // Check URL for logout indicator\n const urlParams = new URLSearchParams(window.location.search);\n const isPostLogout = urlParams.has('logout');\n\n if (isPostLogout) {\n // We're returning from a logout, clear the URL and stay logged out\n window.history.replaceState({}, document.title, window.location.pathname);\n return;\n }\n\n // Check if we're returning from a login redirect\n // Note: handleRedirect() is the modern v7.x replacement for deprecated handleLoginRedirect()\n if (this.oktaAuth.isLoginRedirect()) {\n try {\n await this.oktaAuth.handleRedirect();\n\n // After handling redirect, check if we're authenticated\n const authState = await this.oktaAuth.authStateManager.getAuthState();\n\n if (authState?.isAuthenticated) {\n this.updateAuthState(true);\n\n // Get and update user info\n const idToken = await this.oktaAuth.tokenManager.get('idToken') as IDToken;\n if (idToken) {\n const userInfo = this.mapOktaTokenToStandard(idToken);\n this.updateUserInfo(userInfo);\n }\n }\n } catch (error) {\n console.error('[Okta] Initialization redirect handling error:', error);\n }\n return; // Don't check for existing session after handling redirect\n }\n\n // Only check for existing session if not a redirect\n try {\n const isAuthenticated = await this.oktaAuth.isAuthenticated();\n\n if (isAuthenticated) {\n // Double-check we actually have valid tokens\n const idToken = await this.oktaAuth.tokenManager.get('idToken') as IDToken;\n\n if (idToken?.idToken) {\n this.updateAuthState(true);\n\n // Update user info from cached token\n const userInfo = this.mapOktaTokenToStandard(idToken);\n this.updateUserInfo(userInfo);\n } else {\n // No valid tokens, stay logged out\n this.updateAuthState(false);\n }\n }\n } catch (error) {\n console.warn('[Okta] Error checking authentication status:', error);\n }\n }\n\n protected async loginInternal(options?: Record<string, unknown>): Promise<void> {\n try {\n // Check if we're in a redirect callback\n // Note: handleRedirect() is the modern v7.x replacement for deprecated handleLoginRedirect()\n if (this.oktaAuth.isLoginRedirect()) {\n await this.oktaAuth.handleRedirect();\n return;\n }\n\n // Start the login flow\n await this.oktaAuth.signInWithRedirect({\n originalUri: (options?.['targetUrl'] as string) || '/',\n ...options\n });\n } catch (error) {\n console.error('[Okta] Login error:', error);\n throw error;\n }\n }\n\n protected async logoutInternal(): Promise<void> {\n try {\n // Clear the local authentication state immediately\n this.updateAuthState(false);\n this.updateUserInfo(null);\n\n // Clear all tokens from local storage\n await this.oktaAuth.tokenManager.clear();\n\n // Sign out from Okta completely\n await this.oktaAuth.signOut({\n postLogoutRedirectUri: window.location.origin,\n clearTokensBeforeRedirect: true\n });\n\n // Note: The signOut call will redirect the browser, so code after this won't execute\n } catch (error) {\n console.error('[Okta] Logout error:', error);\n // If logout fails, at least clear local state and reload\n window.location.href = window.location.origin;\n }\n }\n\n async handleCallback(): Promise<void> {\n try {\n // Note: handleRedirect() is the modern v7.x replacement for deprecated handleLoginRedirect()\n if (this.oktaAuth.isLoginRedirect()) {\n await this.oktaAuth.handleRedirect();\n\n // After handling redirect, check if we're authenticated\n const authState = await this.oktaAuth.authStateManager.getAuthState();\n if (authState?.isAuthenticated) {\n // Do a controlled reload after successful login\n setTimeout(() => {\n window.location.href = window.location.origin;\n }, 100);\n }\n }\n } catch (error) {\n console.error('[Okta] Callback handling error:', error);\n throw error;\n }\n }\n\n // ============================================================================\n // ABSTRACT METHOD IMPLEMENTATIONS (v3.0.0)\n // ============================================================================\n\n /**\n * Extract ID token from Okta's storage\n *\n * Okta stores the JWT in IDToken.idToken\n * This is the key abstraction - consumers never need to know about Okta's structure!\n */\n protected async extractIdTokenInternal(): Promise<string | null> {\n try {\n const idToken = await this.oktaAuth.tokenManager.get('idToken') as IDToken;\n // Okta-specific detail: JWT is in idToken property\n return idToken?.idToken || null;\n } catch (error) {\n console.error('[Okta] Error extracting ID token:', error);\n return null;\n }\n }\n\n /**\n * Extract complete token info from Okta\n *\n * Maps Okta's token structure to StandardAuthToken\n */\n protected async extractTokenInfoInternal(): Promise<StandardAuthToken | null> {\n try {\n const idToken = await this.oktaAuth.tokenManager.get('idToken') as IDToken;\n const accessToken = await this.oktaAuth.tokenManager.get('accessToken') as AccessToken;\n\n if (!idToken?.idToken) {\n return null;\n }\n\n return {\n idToken: idToken.idToken,\n accessToken: accessToken?.accessToken,\n expiresAt: idToken.expiresAt ? idToken.expiresAt * 1000 : 0, // Convert to milliseconds\n scopes: idToken.scopes\n };\n } catch (error) {\n console.error('[Okta] Error extracting token info:', error);\n return null;\n }\n }\n\n /**\n * Extract user info from Okta claims\n *\n * Maps Okta's IDToken structure to StandardUserInfo\n */\n protected async extractUserInfoInternal(): Promise<StandardUserInfo | null> {\n try {\n const idToken = await this.oktaAuth.tokenManager.get('idToken') as IDToken;\n if (!idToken) {\n return null;\n }\n\n return this.mapOktaTokenToStandard(idToken);\n } catch (error) {\n console.error('[Okta] Error extracting user info:', error);\n return null;\n }\n }\n\n /**\n * Refresh token using Okta's token renewal\n *\n * Uses renewTokens() to get new tokens silently\n */\n protected async refreshTokenInternal(): Promise<TokenRefreshResult> {\n try {\n console.log('[Okta] Attempting to refresh token...');\n\n // Set flag to prevent authStateManager from triggering updates\n this.isRefreshing = true;\n\n // First check if we're authenticated\n const isAuthenticated = await this.oktaAuth.isAuthenticated();\n\n if (!isAuthenticated) {\n this.isRefreshing = false;\n return {\n success: false,\n error: {\n type: AuthErrorType.NO_ACTIVE_SESSION,\n message: 'User is not authenticated',\n userMessage: 'You need to log in to continue.'\n }\n };\n }\n\n // Check if tokens exist\n const idToken = await this.oktaAuth.tokenManager.get('idToken') as IDToken;\n const accessToken = await this.oktaAuth.tokenManager.get('accessToken') as AccessToken;\n\n if (!idToken || !accessToken) {\n this.isRefreshing = false;\n return {\n success: false,\n error: {\n type: AuthErrorType.NO_ACTIVE_SESSION,\n message: 'No tokens available to refresh',\n userMessage: 'Session not found. Please log in again.'\n }\n };\n }\n\n // Attempt to renew tokens\n const renewedTokens = await this.oktaAuth.token.renewTokens();\n\n if (renewedTokens.idToken) {\n // Store the renewed tokens\n this.oktaAuth.tokenManager.setTokens(renewedTokens);\n\n // Wait a moment before resetting the flag\n await new Promise(resolve => setTimeout(resolve, 100));\n\n this.isRefreshing = false;\n\n const newIdToken = renewedTokens.idToken as IDToken;\n console.log('[Okta] Token refresh successful', {\n expiresAt: newIdToken.expiresAt ? new Date(newIdToken.expiresAt * 1000).toISOString() : 'N/A'\n });\n\n const token: StandardAuthToken = {\n idToken: newIdToken.idToken || '',\n accessToken: renewedTokens.accessToken?.accessToken,\n expiresAt: newIdToken.expiresAt ? newIdToken.expiresAt * 1000 : 0,\n scopes: newIdToken.scopes\n };\n\n return {\n success: true,\n token\n };\n }\n\n this.isRefreshing = false;\n return {\n success: false,\n error: {\n type: AuthErrorType.NO_ACTIVE_SESSION,\n message: 'Token renewal succeeded but no ID token returned',\n userMessage: 'Session refresh failed. Please log in again.'\n }\n };\n } catch (error) {\n console.error('[Okta] Token refresh failed:', error);\n this.isRefreshing = false;\n\n return {\n success: false,\n error: this.classifyErrorInternal(error)\n };\n }\n }\n\n /**\n * Classify Okta-specific errors into semantic types\n *\n * Maps Okta error patterns to AuthErrorType enum.\n * Updated for okta-auth-js v7.x error codes.\n *\n * Error sources:\n * - errorCode: From Okta SDK errors (AuthSdkError, AuthApiError)\n * - error: From OAuth /token endpoint responses (invalid_grant, access_denied, etc.)\n */\n protected classifyErrorInternal(error: unknown): StandardAuthError {\n const errorObj = error as Record<string, unknown>;\n const message = errorObj?.['message'] as string || 'Unknown error';\n const errorCode = errorObj?.['errorCode'] as string || '';\n // OAuth errors from /token endpoint use 'error' field instead of 'errorCode'\n const oauthError = errorObj?.['error'] as string || '';\n\n // Handle invalid_grant - refresh token is invalid or expired\n // This is a common error when refresh tokens expire or are revoked\n if (errorCode === 'invalid_grant' || oauthError === 'invalid_grant' ||\n message.includes('refresh token is invalid or expired')) {\n return {\n type: AuthErrorType.TOKEN_EXPIRED,\n message,\n originalError: error,\n userMessage: 'Your session has expired. Please log in again.'\n };\n }\n\n // Handle access_denied - user or server denied the request\n if (errorCode === 'access_denied' || oauthError === 'access_denied' ||\n message.includes('access_denied')) {\n return {\n type: AuthErrorType.USER_CANCELLED,\n message,\n originalError: error,\n userMessage: 'Access was denied. Please try again.'\n };\n }\n\n // Check for specific Okta error patterns\n if (errorCode === 'login_required' || oauthError === 'login_required' ||\n message.includes('login_required')) {\n return {\n type: AuthErrorType.NO_ACTIVE_SESSION,\n message,\n originalError: error,\n userMessage: 'You need to log in to continue.'\n };\n }\n\n if (message.includes('not to prompt') || message.includes('consent_required') ||\n oauthError === 'consent_required') {\n return {\n type: AuthErrorType.INTERACTION_REQUIRED,\n message,\n originalError: error,\n userMessage: 'Additional authentication is required. Please log in again.'\n };\n }\n\n // Handle both user_cancelled (SDK) and user_canceled_request (OAuth redirect)\n if (errorCode === 'user_cancelled' || errorCode === 'user_canceled_request' ||\n oauthError === 'user_canceled_request' ||\n message.includes('user cancelled') || message.includes('user canceled')) {\n return {\n type: AuthErrorType.USER_CANCELLED,\n message,\n originalError: error,\n userMessage: 'Login was cancelled.'\n };\n }\n\n if (message.includes('token expired') || message.includes('invalid_token') || message.includes('unauthorized')) {\n return {\n type: AuthErrorType.TOKEN_EXPIRED,\n message,\n originalError: error,\n userMessage: 'Your session has expired. Please log in again.'\n };\n }\n\n if (message.includes('network') || message.includes('fetch') || message.includes('Load failed')) {\n return {\n type: AuthErrorType.NETWORK_ERROR,\n message,\n originalError: error,\n userMessage: 'Network error. Please check your connection and try again.'\n };\n }\n\n // Default to unknown error\n return {\n type: AuthErrorType.UNKNOWN_ERROR,\n message,\n originalError: error,\n userMessage: 'An unexpected error occurred. Please try again.'\n };\n }\n\n // ============================================================================\n // HELPER METHODS\n // ============================================================================\n\n /**\n * Map Okta IDToken to StandardUserInfo\n */\n private mapOktaTokenToStandard(idToken: IDToken): StandardUserInfo {\n const claims = idToken.claims;\n\n return {\n id: claims.sub || '',\n email: claims.email as string || '',\n name: claims.name as string || '',\n givenName: claims.given_name as string,\n familyName: claims.family_name as string,\n preferredUsername: claims.preferred_username as string,\n emailVerified: claims.email_verified as boolean\n };\n }\n\n /**\n * Get profile picture URL from Okta\n *\n * Okta may include picture URL in user claims, similar to Auth0.\n * If available, we can also fetch from Okta's /userinfo endpoint.\n */\n protected async getProfilePictureUrlInternal(): Promise<string | null> {\n try {\n const idToken = await this.oktaAuth.tokenManager.get('idToken') as IDToken;\n if (!idToken) {\n return null;\n }\n\n // Check if picture is in claims\n const pictureUrl = idToken.claims.picture as string;\n if (pictureUrl) {\n return pictureUrl;\n }\n\n // Alternatively, fetch from userinfo endpoint\n const user = await this.oktaAuth.getUser();\n return (user?.picture as string) || null;\n } catch (error) {\n console.error('[Okta] Error getting profile picture:', error);\n return null;\n }\n }\n\n /**\n * Handle session expiry - no-op for Okta\n *\n * Okta uses refresh tokens, so it doesn't need interactive re-authentication\n * when tokens expire. If refresh fails, the base class will throw an error\n * and the user must log out/in manually.\n */\n protected async handleSessionExpiryInternal(): Promise<void> {\n // No-op - Okta doesn't need interactive re-auth\n return;\n }\n\n // ============================================================================\n // CONFIGURATION\n // ============================================================================\n\n override getRequiredConfig(): string[] {\n return ['clientId', 'domain'];\n }\n\n override validateConfig(config: Record<string, unknown>): boolean {\n return !!(config['clientId'] && (config['domain'] || config['issuer']));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mjexplorer-okta-provider.service.js","sourceRoot":"","sources":["../../../src/lib/providers/mjexplorer-okta-provider.service.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,OAAO,QAAmD,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAIL,aAAa,EAEd,MAAM,eAAe,CAAC;;AACvB;;;;;;GAMG;AAKI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;;IAgCF;IA/B1C,MAAM,CAAU,aAAa,GAAG,MAAM,CAAC;IAC9B,IAAI,GAAG,gBAAc,CAAC,aAAa,CAAC;IACrC,QAAQ,CAAW;IACnB,YAAY,GAAG,KAAK,CAAC;IAE7B;;;OAGG;IACH,MAAM,CAAC,sBAAsB,GAAG,CAAC,WAAoC,EAAE,EAAE,CAAC;QACxE;YACE,OAAO,EAAE,YAAY;YACrB,QAAQ,EAAE;gBACR,QAAQ,EAAE,WAAW,CAAC,eAAe,CAAC;gBACtC,MAAM,EAAE,WAAW,CAAC,aAAa,CAAC;gBAClC,MAAM,EAAE,WAAW,CAAC,aAAa,CAAC,IAAI,WAAW,WAAW,CAAC,aAAa,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,CAAC,CAAC;IAChC,CAAC;IAEQ,cAAc,CAAC,MAA+B;QACrD,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;wGA/gBU,cAAc,cAgCL,YAAY;gEAhCrB,cAAc,WAAd,cAAc,mBAHb,MAAM;;AAGP,cAAc;IAD1B,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC;GACrB,cAAc,CAghB1B;;iFAhhBY,cAAc;cAJ1B,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;sBAkCc,MAAM;uBAAC,YAAY","sourcesContent":["import { Injectable, Inject } from '@angular/core';\nimport { RegisterClass } from '@memberjunction/global';\nimport { Observable, BehaviorSubject, from } from 'rxjs';\nimport { MJAuthBase } from '../mjexplorer-auth-base.service';\nimport { AngularAuthProviderConfig } from '../IAuthProvider';\nimport OktaAuth, { OktaAuthOptions, IDToken, AccessToken } from '@okta/okta-auth-js';\nimport {\n StandardUserInfo,\n StandardAuthToken,\n StandardAuthError,\n AuthErrorType,\n TokenRefreshResult\n} from '../auth-types';\n/**\n * Okta authentication provider implementation - v3.0.0\n *\n * Implements the abstract methods from MJAuthBase to hide Okta-specific details.\n * The key abstraction is that Okta stores the JWT in IDToken.idToken,\n * but consumers never need to know this detail.\n */\n@Injectable({\n providedIn: 'root'\n})\n@RegisterClass(MJAuthBase, 'okta')\nexport class MJOktaProvider extends MJAuthBase {\n static readonly PROVIDER_TYPE = 'okta';\n readonly type = MJOktaProvider.PROVIDER_TYPE;\n private oktaAuth: OktaAuth;\n private isRefreshing = false;\n\n /**\n * Factory function to provide Angular dependencies required by Okta\n * Stored as a static property for the factory to access without instantiation\n */\n static AngularProviderFactory = (environment: Record<string, unknown>) => [\n {\n provide: 'oktaConfig',\n useValue: {\n clientId: environment['OKTA_CLIENTID'],\n domain: environment['OKTA_DOMAIN'],\n issuer: environment['OKTA_ISSUER'] || `https://${environment['OKTA_DOMAIN']}/oauth2/default`,\n redirectUri: environment['OKTA_REDIRECT_URI'] || window.location.origin,\n scopes: environment['OKTA_SCOPES'] || ['openid', 'profile', 'email']\n }\n }\n ];\n\n /** @deprecated Use {@link AngularProviderFactory}. */\n static get angularProviderFactory() {\n return this.AngularProviderFactory;\n }\n /** @deprecated Use {@link AngularProviderFactory}. */\n static set angularProviderFactory(value) {\n this.AngularProviderFactory = value;\n }\n\n constructor(@Inject('oktaConfig') private oktaConfig: OktaAuthOptions & { domain?: string }) {\n const config: AngularAuthProviderConfig = {\n name: MJOktaProvider.PROVIDER_TYPE,\n type: MJOktaProvider.PROVIDER_TYPE\n };\n super(config);\n\n // Build configuration with defaults\n const oktaAuthConfig: OktaAuthOptions = {\n clientId: this.oktaConfig.clientId,\n redirectUri: this.oktaConfig.redirectUri || window.location.origin + '/callback',\n scopes: this.oktaConfig.scopes || ['openid', 'profile', 'email'],\n pkce: true, // Use PKCE for security\n ...this.oktaConfig,\n // Set issuer after spread to ensure it's not overwritten if not present in config\n issuer: this.oktaConfig.issuer || (this.oktaConfig.domain ? `https://${this.oktaConfig.domain}/oauth2/default` : '')\n };\n\n this.oktaAuth = new OktaAuth(oktaAuthConfig);\n\n // Listen for token events\n this.oktaAuth.authStateManager.subscribe((authState: unknown) => {\n const state = authState as { isAuthenticated?: boolean; idToken?: IDToken };\n this.updateAuthState(state.isAuthenticated || false);\n\n // Don't update user info if we're in the middle of a refresh\n if (!this.isRefreshing) {\n if (state.isAuthenticated && state.idToken) {\n const userInfo = this.mapOktaTokenToStandard(state.idToken);\n this.updateUserInfo(userInfo);\n } else {\n this.updateUserInfo(null);\n }\n }\n });\n }\n\n // ============================================================================\n // LIFECYCLE METHODS\n // ============================================================================\n\n async initialize(): Promise<void> {\n // Check URL for logout indicator\n const urlParams = new URLSearchParams(window.location.search);\n const isPostLogout = urlParams.has('logout');\n\n if (isPostLogout) {\n // We're returning from a logout, clear the URL and stay logged out\n window.history.replaceState({}, document.title, window.location.pathname);\n return;\n }\n\n // Check if we're returning from a login redirect\n // Note: handleRedirect() is the modern v7.x replacement for deprecated handleLoginRedirect()\n if (this.oktaAuth.isLoginRedirect()) {\n try {\n await this.oktaAuth.handleRedirect();\n\n // After handling redirect, check if we're authenticated\n const authState = await this.oktaAuth.authStateManager.getAuthState();\n\n if (authState?.isAuthenticated) {\n this.updateAuthState(true);\n\n // Get and update user info\n const idToken = await this.oktaAuth.tokenManager.get('idToken') as IDToken;\n if (idToken) {\n const userInfo = this.mapOktaTokenToStandard(idToken);\n this.updateUserInfo(userInfo);\n }\n }\n } catch (error) {\n console.error('[Okta] Initialization redirect handling error:', error);\n }\n return; // Don't check for existing session after handling redirect\n }\n\n // Only check for existing session if not a redirect\n try {\n const isAuthenticated = await this.oktaAuth.isAuthenticated();\n\n if (isAuthenticated) {\n // Double-check we actually have valid tokens\n const idToken = await this.oktaAuth.tokenManager.get('idToken') as IDToken;\n\n if (idToken?.idToken) {\n this.updateAuthState(true);\n\n // Update user info from cached token\n const userInfo = this.mapOktaTokenToStandard(idToken);\n this.updateUserInfo(userInfo);\n } else {\n // No valid tokens, stay logged out\n this.updateAuthState(false);\n }\n }\n } catch (error) {\n console.warn('[Okta] Error checking authentication status:', error);\n }\n }\n\n protected async loginInternal(options?: Record<string, unknown>): Promise<void> {\n try {\n // Check if we're in a redirect callback\n // Note: handleRedirect() is the modern v7.x replacement for deprecated handleLoginRedirect()\n if (this.oktaAuth.isLoginRedirect()) {\n await this.oktaAuth.handleRedirect();\n return;\n }\n\n // Start the login flow\n await this.oktaAuth.signInWithRedirect({\n originalUri: (options?.['targetUrl'] as string) || '/',\n ...options\n });\n } catch (error) {\n console.error('[Okta] Login error:', error);\n throw error;\n }\n }\n\n protected async logoutInternal(): Promise<void> {\n try {\n // Clear the local authentication state immediately\n this.updateAuthState(false);\n this.updateUserInfo(null);\n\n // Clear all tokens from local storage\n await this.oktaAuth.tokenManager.clear();\n\n // Sign out from Okta completely\n await this.oktaAuth.signOut({\n postLogoutRedirectUri: window.location.origin,\n clearTokensBeforeRedirect: true\n });\n\n // Note: The signOut call will redirect the browser, so code after this won't execute\n } catch (error) {\n console.error('[Okta] Logout error:', error);\n // If logout fails, at least clear local state and reload\n window.location.href = window.location.origin;\n }\n }\n\n async handleCallback(): Promise<void> {\n try {\n // Note: handleRedirect() is the modern v7.x replacement for deprecated handleLoginRedirect()\n if (this.oktaAuth.isLoginRedirect()) {\n await this.oktaAuth.handleRedirect();\n\n // After handling redirect, check if we're authenticated\n const authState = await this.oktaAuth.authStateManager.getAuthState();\n if (authState?.isAuthenticated) {\n // Do a controlled reload after successful login\n setTimeout(() => {\n window.location.href = window.location.origin;\n }, 100);\n }\n }\n } catch (error) {\n console.error('[Okta] Callback handling error:', error);\n throw error;\n }\n }\n\n // ============================================================================\n // ABSTRACT METHOD IMPLEMENTATIONS (v3.0.0)\n // ============================================================================\n\n /**\n * Extract ID token from Okta's storage\n *\n * Okta stores the JWT in IDToken.idToken\n * This is the key abstraction - consumers never need to know about Okta's structure!\n */\n protected async extractIdTokenInternal(): Promise<string | null> {\n try {\n const idToken = await this.oktaAuth.tokenManager.get('idToken') as IDToken;\n // Okta-specific detail: JWT is in idToken property\n return idToken?.idToken || null;\n } catch (error) {\n console.error('[Okta] Error extracting ID token:', error);\n return null;\n }\n }\n\n /**\n * Extract complete token info from Okta\n *\n * Maps Okta's token structure to StandardAuthToken\n */\n protected async extractTokenInfoInternal(): Promise<StandardAuthToken | null> {\n try {\n const idToken = await this.oktaAuth.tokenManager.get('idToken') as IDToken;\n const accessToken = await this.oktaAuth.tokenManager.get('accessToken') as AccessToken;\n\n if (!idToken?.idToken) {\n return null;\n }\n\n return {\n idToken: idToken.idToken,\n accessToken: accessToken?.accessToken,\n expiresAt: idToken.expiresAt ? idToken.expiresAt * 1000 : 0, // Convert to milliseconds\n scopes: idToken.scopes\n };\n } catch (error) {\n console.error('[Okta] Error extracting token info:', error);\n return null;\n }\n }\n\n /**\n * Extract user info from Okta claims\n *\n * Maps Okta's IDToken structure to StandardUserInfo\n */\n protected async extractUserInfoInternal(): Promise<StandardUserInfo | null> {\n try {\n const idToken = await this.oktaAuth.tokenManager.get('idToken') as IDToken;\n if (!idToken) {\n return null;\n }\n\n return this.mapOktaTokenToStandard(idToken);\n } catch (error) {\n console.error('[Okta] Error extracting user info:', error);\n return null;\n }\n }\n\n /**\n * Refresh token using Okta's token renewal\n *\n * Uses renewTokens() to get new tokens silently\n */\n protected async refreshTokenInternal(): Promise<TokenRefreshResult> {\n try {\n console.log('[Okta] Attempting to refresh token...');\n\n // Set flag to prevent authStateManager from triggering updates\n this.isRefreshing = true;\n\n // First check if we're authenticated\n const isAuthenticated = await this.oktaAuth.isAuthenticated();\n\n if (!isAuthenticated) {\n this.isRefreshing = false;\n return {\n success: false,\n error: {\n type: AuthErrorType.NO_ACTIVE_SESSION,\n message: 'User is not authenticated',\n userMessage: 'You need to log in to continue.'\n }\n };\n }\n\n // Check if tokens exist\n const idToken = await this.oktaAuth.tokenManager.get('idToken') as IDToken;\n const accessToken = await this.oktaAuth.tokenManager.get('accessToken') as AccessToken;\n\n if (!idToken || !accessToken) {\n this.isRefreshing = false;\n return {\n success: false,\n error: {\n type: AuthErrorType.NO_ACTIVE_SESSION,\n message: 'No tokens available to refresh',\n userMessage: 'Session not found. Please log in again.'\n }\n };\n }\n\n // Attempt to renew tokens\n const renewedTokens = await this.oktaAuth.token.renewTokens();\n\n if (renewedTokens.idToken) {\n // Store the renewed tokens\n this.oktaAuth.tokenManager.setTokens(renewedTokens);\n\n // Wait a moment before resetting the flag\n await new Promise(resolve => setTimeout(resolve, 100));\n\n this.isRefreshing = false;\n\n const newIdToken = renewedTokens.idToken as IDToken;\n console.log('[Okta] Token refresh successful', {\n expiresAt: newIdToken.expiresAt ? new Date(newIdToken.expiresAt * 1000).toISOString() : 'N/A'\n });\n\n const token: StandardAuthToken = {\n idToken: newIdToken.idToken || '',\n accessToken: renewedTokens.accessToken?.accessToken,\n expiresAt: newIdToken.expiresAt ? newIdToken.expiresAt * 1000 : 0,\n scopes: newIdToken.scopes\n };\n\n return {\n success: true,\n token\n };\n }\n\n this.isRefreshing = false;\n return {\n success: false,\n error: {\n type: AuthErrorType.NO_ACTIVE_SESSION,\n message: 'Token renewal succeeded but no ID token returned',\n userMessage: 'Session refresh failed. Please log in again.'\n }\n };\n } catch (error) {\n console.error('[Okta] Token refresh failed:', error);\n this.isRefreshing = false;\n\n return {\n success: false,\n error: this.classifyErrorInternal(error)\n };\n }\n }\n\n /**\n * Classify Okta-specific errors into semantic types\n *\n * Maps Okta error patterns to AuthErrorType enum.\n * Updated for okta-auth-js v7.x error codes.\n *\n * Error sources:\n * - errorCode: From Okta SDK errors (AuthSdkError, AuthApiError)\n * - error: From OAuth /token endpoint responses (invalid_grant, access_denied, etc.)\n */\n protected classifyErrorInternal(error: unknown): StandardAuthError {\n const errorObj = error as Record<string, unknown>;\n const message = errorObj?.['message'] as string || 'Unknown error';\n const errorCode = errorObj?.['errorCode'] as string || '';\n // OAuth errors from /token endpoint use 'error' field instead of 'errorCode'\n const oauthError = errorObj?.['error'] as string || '';\n\n // Handle invalid_grant - refresh token is invalid or expired\n // This is a common error when refresh tokens expire or are revoked\n if (errorCode === 'invalid_grant' || oauthError === 'invalid_grant' ||\n message.includes('refresh token is invalid or expired')) {\n return {\n type: AuthErrorType.TOKEN_EXPIRED,\n message,\n originalError: error,\n userMessage: 'Your session has expired. Please log in again.'\n };\n }\n\n // Handle access_denied - user or server denied the request\n if (errorCode === 'access_denied' || oauthError === 'access_denied' ||\n message.includes('access_denied')) {\n return {\n type: AuthErrorType.USER_CANCELLED,\n message,\n originalError: error,\n userMessage: 'Access was denied. Please try again.'\n };\n }\n\n // Check for specific Okta error patterns\n if (errorCode === 'login_required' || oauthError === 'login_required' ||\n message.includes('login_required')) {\n return {\n type: AuthErrorType.NO_ACTIVE_SESSION,\n message,\n originalError: error,\n userMessage: 'You need to log in to continue.'\n };\n }\n\n if (message.includes('not to prompt') || message.includes('consent_required') ||\n oauthError === 'consent_required') {\n return {\n type: AuthErrorType.INTERACTION_REQUIRED,\n message,\n originalError: error,\n userMessage: 'Additional authentication is required. Please log in again.'\n };\n }\n\n // Handle both user_cancelled (SDK) and user_canceled_request (OAuth redirect)\n if (errorCode === 'user_cancelled' || errorCode === 'user_canceled_request' ||\n oauthError === 'user_canceled_request' ||\n message.includes('user cancelled') || message.includes('user canceled')) {\n return {\n type: AuthErrorType.USER_CANCELLED,\n message,\n originalError: error,\n userMessage: 'Login was cancelled.'\n };\n }\n\n if (message.includes('token expired') || message.includes('invalid_token') || message.includes('unauthorized')) {\n return {\n type: AuthErrorType.TOKEN_EXPIRED,\n message,\n originalError: error,\n userMessage: 'Your session has expired. Please log in again.'\n };\n }\n\n if (message.includes('network') || message.includes('fetch') || message.includes('Load failed')) {\n return {\n type: AuthErrorType.NETWORK_ERROR,\n message,\n originalError: error,\n userMessage: 'Network error. Please check your connection and try again.'\n };\n }\n\n // Default to unknown error\n return {\n type: AuthErrorType.UNKNOWN_ERROR,\n message,\n originalError: error,\n userMessage: 'An unexpected error occurred. Please try again.'\n };\n }\n\n // ============================================================================\n // HELPER METHODS\n // ============================================================================\n\n /**\n * Map Okta IDToken to StandardUserInfo\n */\n private mapOktaTokenToStandard(idToken: IDToken): StandardUserInfo {\n const claims = idToken.claims;\n\n return {\n id: claims.sub || '',\n email: claims.email as string || '',\n name: claims.name as string || '',\n givenName: claims.given_name as string,\n familyName: claims.family_name as string,\n preferredUsername: claims.preferred_username as string,\n emailVerified: claims.email_verified as boolean\n };\n }\n\n /**\n * Get profile picture URL from Okta\n *\n * Okta may include picture URL in user claims, similar to Auth0.\n * If available, we can also fetch from Okta's /userinfo endpoint.\n */\n protected async getProfilePictureUrlInternal(): Promise<string | null> {\n try {\n const idToken = await this.oktaAuth.tokenManager.get('idToken') as IDToken;\n if (!idToken) {\n return null;\n }\n\n // Check if picture is in claims\n const pictureUrl = idToken.claims.picture as string;\n if (pictureUrl) {\n return pictureUrl;\n }\n\n // Alternatively, fetch from userinfo endpoint\n const user = await this.oktaAuth.getUser();\n return (user?.picture as string) || null;\n } catch (error) {\n console.error('[Okta] Error getting profile picture:', error);\n return null;\n }\n }\n\n /**\n * Handle session expiry - no-op for Okta\n *\n * Okta uses refresh tokens, so it doesn't need interactive re-authentication\n * when tokens expire. If refresh fails, the base class will throw an error\n * and the user must log out/in manually.\n */\n protected async handleSessionExpiryInternal(): Promise<void> {\n // No-op - Okta doesn't need interactive re-auth\n return;\n }\n\n // ============================================================================\n // CONFIGURATION\n // ============================================================================\n\n override getRequiredConfig(): string[] {\n return ['clientId', 'domain'];\n }\n\n override validateConfig(config: Record<string, unknown>): boolean {\n return !!(config['clientId'] && (config['domain'] || config['issuer']));\n }\n}\n"]}
|
|
@@ -43,7 +43,7 @@ export declare class MJWorkOSProvider extends MJAuthBase implements OnDestroy {
|
|
|
43
43
|
* Factory function to provide the Angular dependencies required by WorkOS.
|
|
44
44
|
* Stored as a static property so the factory can read it without instantiation.
|
|
45
45
|
*/
|
|
46
|
-
static
|
|
46
|
+
static AngularProviderFactory: (environment: Record<string, unknown>) => {
|
|
47
47
|
provide: string;
|
|
48
48
|
useValue: {
|
|
49
49
|
clientId: string;
|
|
@@ -52,6 +52,26 @@ export declare class MJWorkOSProvider extends MJAuthBase implements OnDestroy {
|
|
|
52
52
|
devMode: boolean;
|
|
53
53
|
};
|
|
54
54
|
}[];
|
|
55
|
+
/** @deprecated Use {@link AngularProviderFactory}. */
|
|
56
|
+
static get angularProviderFactory(): (environment: Record<string, unknown>) => {
|
|
57
|
+
provide: string;
|
|
58
|
+
useValue: {
|
|
59
|
+
clientId: string;
|
|
60
|
+
redirectUri: string;
|
|
61
|
+
apiHostname: string | undefined;
|
|
62
|
+
devMode: boolean;
|
|
63
|
+
};
|
|
64
|
+
}[];
|
|
65
|
+
/** @deprecated Use {@link AngularProviderFactory}. */
|
|
66
|
+
static set angularProviderFactory(value: (environment: Record<string, unknown>) => {
|
|
67
|
+
provide: string;
|
|
68
|
+
useValue: {
|
|
69
|
+
clientId: string;
|
|
70
|
+
redirectUri: string;
|
|
71
|
+
apiHostname: string | undefined;
|
|
72
|
+
devMode: boolean;
|
|
73
|
+
};
|
|
74
|
+
}[]);
|
|
55
75
|
constructor(workosConfig: WorkOSAuthConfig);
|
|
56
76
|
/**
|
|
57
77
|
* Initialize the AuthKit client. `createClient()` constructs the client AND processes any
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mjexplorer-workos-provider.service.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/mjexplorer-workos-provider.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,SAAS,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAU7D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EAEjB,kBAAkB,EACnB,MAAM,eAAe,CAAC;;AAQvB;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,mGAAmG;IACnG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sFAAsF;IACtF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAIa,gBAAiB,SAAQ,UAAW,YAAW,SAAS;
|
|
1
|
+
{"version":3,"file":"mjexplorer-workos-provider.service.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/mjexplorer-workos-provider.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,SAAS,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAU7D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EAEjB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CAAC,IAAI,CAAC;IAkBzC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAMrC,WAAW,IAAI,IAAI;IAUnB;;;;OAIG;cACa,sBAAsB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAehE;;;OAGG;cACa,wBAAwB,IAAI,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAqB7E;;;OAGG;cACa,uBAAuB,IAAI,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAK3E;;OAEG;cACa,oBAAoB,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAoCnE;;OAEG;IACH,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB;IAuClE;;OAEG;cACa,4BAA4B,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAItE;;;;OAIG;cACa,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC;YAQ9C,iBAAiB;IAM/B;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAkBtB,iBAAiB,IAAI,MAAM,EAAE;IAI7B,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO;yCArUtD,gBAAgB;6CAAhB,gBAAgB;CA0U5B"}
|
|
@@ -39,7 +39,7 @@ let MJWorkOSProvider = class MJWorkOSProvider extends MJAuthBase {
|
|
|
39
39
|
* Factory function to provide the Angular dependencies required by WorkOS.
|
|
40
40
|
* Stored as a static property so the factory can read it without instantiation.
|
|
41
41
|
*/
|
|
42
|
-
static
|
|
42
|
+
static AngularProviderFactory = (environment) => [
|
|
43
43
|
{
|
|
44
44
|
provide: 'workosConfig',
|
|
45
45
|
useValue: {
|
|
@@ -50,6 +50,14 @@ let MJWorkOSProvider = class MJWorkOSProvider extends MJAuthBase {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
];
|
|
53
|
+
/** @deprecated Use {@link AngularProviderFactory}. */
|
|
54
|
+
static get angularProviderFactory() {
|
|
55
|
+
return this.AngularProviderFactory;
|
|
56
|
+
}
|
|
57
|
+
/** @deprecated Use {@link AngularProviderFactory}. */
|
|
58
|
+
static set angularProviderFactory(value) {
|
|
59
|
+
this.AngularProviderFactory = value;
|
|
60
|
+
}
|
|
53
61
|
constructor(workosConfig) {
|
|
54
62
|
const config = {
|
|
55
63
|
name: MJWorkOSProvider_1.PROVIDER_TYPE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mjexplorer-workos-provider.service.js","sourceRoot":"","sources":["../../../src/lib/providers/mjexplorer-workos-provider.service.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAa,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,OAAO,EACL,YAAY,EACZ,SAAS,EAET,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,aAAa,EAEd,MAAM,eAAe,CAAC;;AAuBvB;;;;;;;;;;;;;;;;GAgBG;AAKI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;;IAuBF;IAtB5C,MAAM,CAAU,aAAa,GAAG,QAAQ,CAAC;IAChC,IAAI,GAAG,kBAAgB,CAAC,aAAa,CAAC;IAEvC,MAAM,GAAwB,IAAI,CAAC;IACnC,WAAW,GAAyB,IAAI,CAAC;IAEjD;;;OAGG;IACH,MAAM,CAAC,sBAAsB,GAAG,CAAC,WAAoC,EAAE,EAAE,CAAC;QACxE;YACE,OAAO,EAAE,cAAc;YACvB,QAAQ,EAAE;gBACR,QAAQ,EAAE,WAAW,CAAC,iBAAiB,CAAW;gBAClD,WAAW,EAAG,WAAW,CAAC,qBAAqB,CAAY,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM;gBACrF,WAAW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AgB,mBAHf,MAAM;;AAGP,gBAAgB;IAD5B,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;GACvB,gBAAgB,CAiU5B;;iFAjUY,gBAAgB;cAJ5B,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;sBAyBc,MAAM;uBAAC,cAAc","sourcesContent":["import { Injectable, Inject, OnDestroy } from '@angular/core';\nimport { RegisterClass } from '@memberjunction/global';\nimport { MJAuthBase } from '../mjexplorer-auth-base.service';\nimport { AngularAuthProviderConfig } from '../IAuthProvider';\nimport {\n createClient,\n getClaims,\n User,\n LoginRequiredError,\n NoSessionError,\n RefreshTimeoutError\n} from '@workos-inc/authkit-js';\nimport {\n StandardUserInfo,\n StandardAuthToken,\n StandardAuthError,\n AuthErrorType,\n TokenRefreshResult\n} from '../auth-types';\n\n/**\n * The AuthKit client instance type. The `@workos-inc/authkit-js` package does not export its\n * `Client` class directly, so we derive the type from `createClient`'s resolved return value.\n */\ntype WorkOSClient = Awaited<ReturnType<typeof createClient>>;\n\n/**\n * Resolved configuration for the WorkOS AuthKit client.\n * Provided via the `'workosConfig'` injection token (see `angularProviderFactory`).\n */\nexport interface WorkOSAuthConfig {\n /** WorkOS AuthKit client ID (e.g. `client_01H...`). Required. */\n clientId: string;\n /** OAuth redirect URI registered in the WorkOS dashboard. Defaults to `window.location.origin`. */\n redirectUri?: string;\n /** Override the WorkOS API hostname (rarely needed; for proxies / custom domains). */\n apiHostname?: string;\n /** Enables AuthKit dev mode (localStorage session, no third-party cookies). */\n devMode?: boolean;\n}\n\n/**\n * WorkOS (AuthKit) authentication provider — browser side.\n *\n * Wraps the vanilla-JS `@workos-inc/authkit-js` SDK behind {@link MJAuthBase} so the rest of\n * MemberJunction never sees WorkOS-specific details. AuthKit issues a JWT **access token**\n * (returned by `getAccessToken()`) that MJ sends to the GraphQL API as a Bearer token; the\n * server validates it via `@memberjunction/auth-providers`' `WorkOSProvider`.\n *\n * Unlike the Auth0/MSAL/Okta providers, AuthKit is not an Angular library — there is no module\n * to import. This provider creates the client itself in {@link initialize} using config supplied\n * through the `'workosConfig'` injection token.\n *\n * > **Email note:** `getUser()` always returns the user's email for display here, but the\n * > **access token** only carries `email` if a WorkOS JWT Template adds it. MJ resolves users by\n * > email server-side, so configuring that template is required. See `WORKOS.md` in\n * > `@memberjunction/auth-providers`.\n */\n@Injectable({\n providedIn: 'root'\n})\n@RegisterClass(MJAuthBase, 'workos')\nexport class MJWorkOSProvider extends MJAuthBase implements OnDestroy {\n static readonly PROVIDER_TYPE = 'workos';\n readonly type = MJWorkOSProvider.PROVIDER_TYPE;\n\n private client: WorkOSClient | null = null;\n private initPromise: Promise<void> | null = null;\n\n /**\n * Factory function to provide the Angular dependencies required by WorkOS.\n * Stored as a static property so the factory can read it without instantiation.\n */\n static angularProviderFactory = (environment: Record<string, unknown>) => [\n {\n provide: 'workosConfig',\n useValue: {\n clientId: environment['WORKOS_CLIENTID'] as string,\n redirectUri: (environment['WORKOS_REDIRECT_URI'] as string) || window.location.origin,\n apiHostname: environment['WORKOS_API_HOSTNAME'] as string | undefined,\n devMode: (environment['WORKOS_DEV_MODE'] as boolean | undefined) ?? false\n } satisfies WorkOSAuthConfig\n }\n ];\n\n constructor(@Inject('workosConfig') private workosConfig: WorkOSAuthConfig) {\n const config: AngularAuthProviderConfig = {\n name: MJWorkOSProvider.PROVIDER_TYPE,\n type: MJWorkOSProvider.PROVIDER_TYPE\n };\n super(config);\n }\n\n // ============================================================================\n // LIFECYCLE METHODS\n // ============================================================================\n\n /**\n * Initialize the AuthKit client. `createClient()` constructs the client AND processes any\n * pending OAuth redirect (it reads the `code` from the URL and exchanges it), so once it\n * resolves the session — if any — is already established and `getUser()` is populated.\n *\n * Idempotent and concurrency-safe: parallel callers share a single in-flight promise.\n */\n async initialize(): Promise<void> {\n if (this.client) {\n return;\n }\n if (this.initPromise) {\n return this.initPromise;\n }\n\n this.initPromise = this.createAndSyncClient();\n try {\n await this.initPromise;\n } finally {\n this.initPromise = null;\n }\n }\n\n private async createAndSyncClient(): Promise<void> {\n this.client = await createClient(this.workosConfig.clientId, {\n redirectUri: this.workosConfig.redirectUri,\n apiHostname: this.workosConfig.apiHostname,\n devMode: this.workosConfig.devMode,\n // Keep MJ's reactive auth state in lockstep with AuthKit's silent refresh cycle.\n onRefresh: () => this.syncSessionState(),\n onRefreshFailure: () => {\n this.updateAuthState(false);\n this.updateUserInfo(null);\n }\n });\n\n this.syncSessionState();\n }\n\n /**\n * Pushes the current AuthKit session into MJ's reactive streams.\n */\n private syncSessionState(): void {\n const user = this.client?.getUser() ?? null;\n if (user) {\n this.updateAuthState(true);\n this.updateUserInfo(this.mapWorkOSUserToStandard(user));\n } else {\n this.updateAuthState(false);\n this.updateUserInfo(null);\n }\n }\n\n protected async loginInternal(options?: Record<string, unknown>): Promise<void> {\n await this.ensureInitialized();\n // signIn redirects the browser to the WorkOS hosted login page. Any caller-supplied\n // options (loginHint, organizationId, state, …) are passed straight through.\n await this.client!.signIn(options);\n }\n\n protected async logoutInternal(): Promise<void> {\n // signOut clears the AuthKit session and redirects to the app's configured Logout URI.\n // If there is no active session it throws NoSessionError — provide returnTo so the user is\n // still returned to the app rather than left on a dead page.\n this.updateAuthState(false);\n this.updateUserInfo(null);\n try {\n this.client?.signOut({ returnTo: this.workosConfig.redirectUri || window.location.origin });\n } catch (error) {\n // NoSessionError (no active session) — just hard-redirect home.\n if (error instanceof NoSessionError) {\n window.location.href = window.location.origin;\n } else {\n throw error;\n }\n }\n }\n\n async handleCallback(): Promise<void> {\n // AuthKit's createClient() processes the redirect internally during initialize().\n // This method exists for interface compatibility (mirrors the Auth0 provider).\n await this.ensureInitialized();\n }\n\n ngOnDestroy(): void {\n // Release the AuthKit refresh timer / listeners.\n this.client?.dispose();\n this.client = null;\n }\n\n // ============================================================================\n // ABSTRACT METHOD IMPLEMENTATIONS\n // ============================================================================\n\n /**\n * Extract the access token (a JWT) from AuthKit. `getAccessToken()` returns a valid token,\n * silently refreshing first if the current one is near expiry. Throws when there is no\n * session — we translate that to `null` so callers can treat it as \"not authenticated\".\n */\n protected async extractIdTokenInternal(): Promise<string | null> {\n if (!this.client) {\n return null;\n }\n try {\n return await this.client.getAccessToken();\n } catch (error) {\n if (error instanceof LoginRequiredError) {\n return null;\n }\n console.error('[WorkOS] Error extracting access token:', error);\n return null;\n }\n }\n\n /**\n * Extract complete token info. The expiry comes from the JWT's `exp` claim, decoded with the\n * SDK's `getClaims()` helper.\n */\n protected async extractTokenInfoInternal(): Promise<StandardAuthToken | null> {\n const accessToken = await this.extractIdTokenInternal();\n if (!accessToken) {\n return null;\n }\n\n let expiresAt = 0;\n try {\n const claims = getClaims(accessToken);\n expiresAt = claims.exp ? claims.exp * 1000 : 0; // exp is seconds → milliseconds\n } catch (error) {\n console.warn('[WorkOS] Could not decode access token claims:', error);\n }\n\n return {\n idToken: accessToken,\n accessToken,\n expiresAt\n };\n }\n\n /**\n * Extract user info from AuthKit's in-memory user (always populated when authenticated,\n * regardless of which claims the access token carries).\n */\n protected async extractUserInfoInternal(): Promise<StandardUserInfo | null> {\n const user = this.client?.getUser() ?? null;\n return user ? this.mapWorkOSUserToStandard(user) : null;\n }\n\n /**\n * Force a token refresh through AuthKit's refresh-token rotation.\n */\n protected async refreshTokenInternal(): Promise<TokenRefreshResult> {\n if (!this.client) {\n return {\n success: false,\n error: {\n type: AuthErrorType.NO_ACTIVE_SESSION,\n message: 'WorkOS client not initialized',\n userMessage: 'You need to log in to continue.'\n }\n };\n }\n\n try {\n const accessToken = await this.client.getAccessToken({ forceRefresh: true });\n this.syncSessionState();\n\n let expiresAt = 0;\n try {\n const claims = getClaims(accessToken);\n expiresAt = claims.exp ? claims.exp * 1000 : 0;\n } catch {\n // exp decode is best-effort; a missing value just means the consumer can't pre-empt expiry.\n }\n\n return {\n success: true,\n token: { idToken: accessToken, accessToken, expiresAt }\n };\n } catch (error) {\n return {\n success: false,\n error: this.classifyErrorInternal(error)\n };\n }\n }\n\n /**\n * Map WorkOS / AuthKit SDK errors to semantic `AuthErrorType` values.\n */\n protected classifyErrorInternal(error: unknown): StandardAuthError {\n if (error instanceof LoginRequiredError || error instanceof NoSessionError) {\n return {\n type: AuthErrorType.NO_ACTIVE_SESSION,\n message: (error as Error).message,\n originalError: error,\n userMessage: 'You need to log in to continue.'\n };\n }\n\n // RefreshTimeoutError is exported; its parent `RefreshError` is not, so we also match by\n // constructor name to catch any non-timeout refresh failure.\n if (error instanceof RefreshTimeoutError || (error as Error)?.name === 'RefreshError') {\n return {\n type: AuthErrorType.TOKEN_EXPIRED,\n message: (error as Error).message,\n originalError: error,\n userMessage: 'Your session has expired. Please log in again.'\n };\n }\n\n const message = (error as { message?: string })?.message || 'Unknown error';\n if (message.includes('network') || message.includes('fetch') || message.includes('Failed to fetch')) {\n return {\n type: AuthErrorType.NETWORK_ERROR,\n message,\n originalError: error,\n userMessage: 'Network error. Please check your connection and try again.'\n };\n }\n\n return {\n type: AuthErrorType.UNKNOWN_ERROR,\n message,\n originalError: error,\n userMessage: 'An unexpected error occurred. Please try again.'\n };\n }\n\n /**\n * WorkOS includes the profile picture URL on the user object — no extra API call needed.\n */\n protected async getProfilePictureUrlInternal(): Promise<string | null> {\n return this.client?.getUser()?.profilePictureUrl ?? null;\n }\n\n /**\n * No-op. WorkOS uses rotating refresh tokens, so it doesn't need interactive\n * re-authentication when an access token expires; if refresh fails the base class surfaces\n * the error and the user re-logs in manually.\n */\n protected async handleSessionExpiryInternal(): Promise<void> {\n return;\n }\n\n // ============================================================================\n // HELPER METHODS\n // ============================================================================\n\n private async ensureInitialized(): Promise<void> {\n if (!this.client) {\n await this.initialize();\n }\n }\n\n /**\n * Map a WorkOS `User` to the framework-standard `StandardUserInfo`.\n * WorkOS exposes `firstName`/`lastName` as `string | null`; we normalize null → undefined.\n */\n private mapWorkOSUserToStandard(user: User): StandardUserInfo {\n const fullName = [user.firstName, user.lastName].filter(Boolean).join(' ');\n return {\n id: user.id,\n email: user.email,\n name: fullName || user.email,\n givenName: user.firstName ?? undefined,\n familyName: user.lastName ?? undefined,\n preferredUsername: user.email,\n pictureUrl: user.profilePictureUrl ?? undefined,\n emailVerified: user.emailVerified\n };\n }\n\n // ============================================================================\n // CONFIGURATION\n // ============================================================================\n\n override getRequiredConfig(): string[] {\n return ['clientId'];\n }\n\n override validateConfig(config: Record<string, unknown>): boolean {\n // The real config arrives via the 'workosConfig' injection token; the only hard\n // requirement is a clientId.\n return !!this.workosConfig?.clientId || !!config['clientId'];\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mjexplorer-workos-provider.service.js","sourceRoot":"","sources":["../../../src/lib/providers/mjexplorer-workos-provider.service.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAa,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,OAAO,EACL,YAAY,EACZ,SAAS,EAET,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,aAAa,EAEd,MAAM,eAAe,CAAC;;AAuBvB;;;;;;;;;;;;;;;;GAgBG;AAKI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;;IAgCF;IA/B5C,MAAM,CAAU,aAAa,GAAG,QAAQ,CAAC;IAChC,IAAI,GAAG,kBAAgB,CAAC,aAAa,CAAC;IAEvC,MAAM,GAAwB,IAAI,CAAC;IACnC,WAAW,GAAyB,IAAI,CAAC;IAEjD;;;OAGG;IACH,MAAM,CAAC,sBAAsB,GAAG,CAAC,WAAoC,EAAE,EAAE,CAAC;QACxE;YACE,OAAO,EAAE,cAAc;YACvB,QAAQ,EAAE;gBACR,QAAQ,EAAE,WAAW,CAAC,iBAAiB,CAAW;gBAClD,WAAW,EAAG,WAAW,CAAC,qBAAqB,CAAY,IAAI,MAAM,CAAC,QAAQ,CAA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,CAAC,MAA+B;QACrD,gFAAgF;QAChF,6BAA6B;QAC7B,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC/D,CAAC;0GAzUU,gBAAgB,cAgCP,cAAc;gEAhCvB,gBAAgB,WAAhB,gBAAgB,mBAHf,MAAM;;AAGP,gBAAgB;IAD5B,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;GACvB,gBAAgB,CA0U5B;;iFA1UY,gBAAgB;cAJ5B,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;sBAkCc,MAAM;uBAAC,cAAc","sourcesContent":["import { Injectable, Inject, OnDestroy } from '@angular/core';\nimport { RegisterClass } from '@memberjunction/global';\nimport { MJAuthBase } from '../mjexplorer-auth-base.service';\nimport { AngularAuthProviderConfig } from '../IAuthProvider';\nimport {\n createClient,\n getClaims,\n User,\n LoginRequiredError,\n NoSessionError,\n RefreshTimeoutError\n} from '@workos-inc/authkit-js';\nimport {\n StandardUserInfo,\n StandardAuthToken,\n StandardAuthError,\n AuthErrorType,\n TokenRefreshResult\n} from '../auth-types';\n\n/**\n * The AuthKit client instance type. The `@workos-inc/authkit-js` package does not export its\n * `Client` class directly, so we derive the type from `createClient`'s resolved return value.\n */\ntype WorkOSClient = Awaited<ReturnType<typeof createClient>>;\n\n/**\n * Resolved configuration for the WorkOS AuthKit client.\n * Provided via the `'workosConfig'` injection token (see `angularProviderFactory`).\n */\nexport interface WorkOSAuthConfig {\n /** WorkOS AuthKit client ID (e.g. `client_01H...`). Required. */\n clientId: string;\n /** OAuth redirect URI registered in the WorkOS dashboard. Defaults to `window.location.origin`. */\n redirectUri?: string;\n /** Override the WorkOS API hostname (rarely needed; for proxies / custom domains). */\n apiHostname?: string;\n /** Enables AuthKit dev mode (localStorage session, no third-party cookies). */\n devMode?: boolean;\n}\n\n/**\n * WorkOS (AuthKit) authentication provider — browser side.\n *\n * Wraps the vanilla-JS `@workos-inc/authkit-js` SDK behind {@link MJAuthBase} so the rest of\n * MemberJunction never sees WorkOS-specific details. AuthKit issues a JWT **access token**\n * (returned by `getAccessToken()`) that MJ sends to the GraphQL API as a Bearer token; the\n * server validates it via `@memberjunction/auth-providers`' `WorkOSProvider`.\n *\n * Unlike the Auth0/MSAL/Okta providers, AuthKit is not an Angular library — there is no module\n * to import. This provider creates the client itself in {@link initialize} using config supplied\n * through the `'workosConfig'` injection token.\n *\n * > **Email note:** `getUser()` always returns the user's email for display here, but the\n * > **access token** only carries `email` if a WorkOS JWT Template adds it. MJ resolves users by\n * > email server-side, so configuring that template is required. See `WORKOS.md` in\n * > `@memberjunction/auth-providers`.\n */\n@Injectable({\n providedIn: 'root'\n})\n@RegisterClass(MJAuthBase, 'workos')\nexport class MJWorkOSProvider extends MJAuthBase implements OnDestroy {\n static readonly PROVIDER_TYPE = 'workos';\n readonly type = MJWorkOSProvider.PROVIDER_TYPE;\n\n private client: WorkOSClient | null = null;\n private initPromise: Promise<void> | null = null;\n\n /**\n * Factory function to provide the Angular dependencies required by WorkOS.\n * Stored as a static property so the factory can read it without instantiation.\n */\n static AngularProviderFactory = (environment: Record<string, unknown>) => [\n {\n provide: 'workosConfig',\n useValue: {\n clientId: environment['WORKOS_CLIENTID'] as string,\n redirectUri: (environment['WORKOS_REDIRECT_URI'] as string) || window.location.origin,\n apiHostname: environment['WORKOS_API_HOSTNAME'] as string | undefined,\n devMode: (environment['WORKOS_DEV_MODE'] as boolean | undefined) ?? false\n } satisfies WorkOSAuthConfig\n }\n ];\n\n /** @deprecated Use {@link AngularProviderFactory}. */\n static get angularProviderFactory() {\n return this.AngularProviderFactory;\n }\n /** @deprecated Use {@link AngularProviderFactory}. */\n static set angularProviderFactory(value) {\n this.AngularProviderFactory = value;\n }\n\n constructor(@Inject('workosConfig') private workosConfig: WorkOSAuthConfig) {\n const config: AngularAuthProviderConfig = {\n name: MJWorkOSProvider.PROVIDER_TYPE,\n type: MJWorkOSProvider.PROVIDER_TYPE\n };\n super(config);\n }\n\n // ============================================================================\n // LIFECYCLE METHODS\n // ============================================================================\n\n /**\n * Initialize the AuthKit client. `createClient()` constructs the client AND processes any\n * pending OAuth redirect (it reads the `code` from the URL and exchanges it), so once it\n * resolves the session — if any — is already established and `getUser()` is populated.\n *\n * Idempotent and concurrency-safe: parallel callers share a single in-flight promise.\n */\n async initialize(): Promise<void> {\n if (this.client) {\n return;\n }\n if (this.initPromise) {\n return this.initPromise;\n }\n\n this.initPromise = this.createAndSyncClient();\n try {\n await this.initPromise;\n } finally {\n this.initPromise = null;\n }\n }\n\n private async createAndSyncClient(): Promise<void> {\n this.client = await createClient(this.workosConfig.clientId, {\n redirectUri: this.workosConfig.redirectUri,\n apiHostname: this.workosConfig.apiHostname,\n devMode: this.workosConfig.devMode,\n // Keep MJ's reactive auth state in lockstep with AuthKit's silent refresh cycle.\n onRefresh: () => this.syncSessionState(),\n onRefreshFailure: () => {\n this.updateAuthState(false);\n this.updateUserInfo(null);\n }\n });\n\n this.syncSessionState();\n }\n\n /**\n * Pushes the current AuthKit session into MJ's reactive streams.\n */\n private syncSessionState(): void {\n const user = this.client?.getUser() ?? null;\n if (user) {\n this.updateAuthState(true);\n this.updateUserInfo(this.mapWorkOSUserToStandard(user));\n } else {\n this.updateAuthState(false);\n this.updateUserInfo(null);\n }\n }\n\n protected async loginInternal(options?: Record<string, unknown>): Promise<void> {\n await this.ensureInitialized();\n // signIn redirects the browser to the WorkOS hosted login page. Any caller-supplied\n // options (loginHint, organizationId, state, …) are passed straight through.\n await this.client!.signIn(options);\n }\n\n protected async logoutInternal(): Promise<void> {\n // signOut clears the AuthKit session and redirects to the app's configured Logout URI.\n // If there is no active session it throws NoSessionError — provide returnTo so the user is\n // still returned to the app rather than left on a dead page.\n this.updateAuthState(false);\n this.updateUserInfo(null);\n try {\n this.client?.signOut({ returnTo: this.workosConfig.redirectUri || window.location.origin });\n } catch (error) {\n // NoSessionError (no active session) — just hard-redirect home.\n if (error instanceof NoSessionError) {\n window.location.href = window.location.origin;\n } else {\n throw error;\n }\n }\n }\n\n async handleCallback(): Promise<void> {\n // AuthKit's createClient() processes the redirect internally during initialize().\n // This method exists for interface compatibility (mirrors the Auth0 provider).\n await this.ensureInitialized();\n }\n\n ngOnDestroy(): void {\n // Release the AuthKit refresh timer / listeners.\n this.client?.dispose();\n this.client = null;\n }\n\n // ============================================================================\n // ABSTRACT METHOD IMPLEMENTATIONS\n // ============================================================================\n\n /**\n * Extract the access token (a JWT) from AuthKit. `getAccessToken()` returns a valid token,\n * silently refreshing first if the current one is near expiry. Throws when there is no\n * session — we translate that to `null` so callers can treat it as \"not authenticated\".\n */\n protected async extractIdTokenInternal(): Promise<string | null> {\n if (!this.client) {\n return null;\n }\n try {\n return await this.client.getAccessToken();\n } catch (error) {\n if (error instanceof LoginRequiredError) {\n return null;\n }\n console.error('[WorkOS] Error extracting access token:', error);\n return null;\n }\n }\n\n /**\n * Extract complete token info. The expiry comes from the JWT's `exp` claim, decoded with the\n * SDK's `getClaims()` helper.\n */\n protected async extractTokenInfoInternal(): Promise<StandardAuthToken | null> {\n const accessToken = await this.extractIdTokenInternal();\n if (!accessToken) {\n return null;\n }\n\n let expiresAt = 0;\n try {\n const claims = getClaims(accessToken);\n expiresAt = claims.exp ? claims.exp * 1000 : 0; // exp is seconds → milliseconds\n } catch (error) {\n console.warn('[WorkOS] Could not decode access token claims:', error);\n }\n\n return {\n idToken: accessToken,\n accessToken,\n expiresAt\n };\n }\n\n /**\n * Extract user info from AuthKit's in-memory user (always populated when authenticated,\n * regardless of which claims the access token carries).\n */\n protected async extractUserInfoInternal(): Promise<StandardUserInfo | null> {\n const user = this.client?.getUser() ?? null;\n return user ? this.mapWorkOSUserToStandard(user) : null;\n }\n\n /**\n * Force a token refresh through AuthKit's refresh-token rotation.\n */\n protected async refreshTokenInternal(): Promise<TokenRefreshResult> {\n if (!this.client) {\n return {\n success: false,\n error: {\n type: AuthErrorType.NO_ACTIVE_SESSION,\n message: 'WorkOS client not initialized',\n userMessage: 'You need to log in to continue.'\n }\n };\n }\n\n try {\n const accessToken = await this.client.getAccessToken({ forceRefresh: true });\n this.syncSessionState();\n\n let expiresAt = 0;\n try {\n const claims = getClaims(accessToken);\n expiresAt = claims.exp ? claims.exp * 1000 : 0;\n } catch {\n // exp decode is best-effort; a missing value just means the consumer can't pre-empt expiry.\n }\n\n return {\n success: true,\n token: { idToken: accessToken, accessToken, expiresAt }\n };\n } catch (error) {\n return {\n success: false,\n error: this.classifyErrorInternal(error)\n };\n }\n }\n\n /**\n * Map WorkOS / AuthKit SDK errors to semantic `AuthErrorType` values.\n */\n protected classifyErrorInternal(error: unknown): StandardAuthError {\n if (error instanceof LoginRequiredError || error instanceof NoSessionError) {\n return {\n type: AuthErrorType.NO_ACTIVE_SESSION,\n message: (error as Error).message,\n originalError: error,\n userMessage: 'You need to log in to continue.'\n };\n }\n\n // RefreshTimeoutError is exported; its parent `RefreshError` is not, so we also match by\n // constructor name to catch any non-timeout refresh failure.\n if (error instanceof RefreshTimeoutError || (error as Error)?.name === 'RefreshError') {\n return {\n type: AuthErrorType.TOKEN_EXPIRED,\n message: (error as Error).message,\n originalError: error,\n userMessage: 'Your session has expired. Please log in again.'\n };\n }\n\n const message = (error as { message?: string })?.message || 'Unknown error';\n if (message.includes('network') || message.includes('fetch') || message.includes('Failed to fetch')) {\n return {\n type: AuthErrorType.NETWORK_ERROR,\n message,\n originalError: error,\n userMessage: 'Network error. Please check your connection and try again.'\n };\n }\n\n return {\n type: AuthErrorType.UNKNOWN_ERROR,\n message,\n originalError: error,\n userMessage: 'An unexpected error occurred. Please try again.'\n };\n }\n\n /**\n * WorkOS includes the profile picture URL on the user object — no extra API call needed.\n */\n protected async getProfilePictureUrlInternal(): Promise<string | null> {\n return this.client?.getUser()?.profilePictureUrl ?? null;\n }\n\n /**\n * No-op. WorkOS uses rotating refresh tokens, so it doesn't need interactive\n * re-authentication when an access token expires; if refresh fails the base class surfaces\n * the error and the user re-logs in manually.\n */\n protected async handleSessionExpiryInternal(): Promise<void> {\n return;\n }\n\n // ============================================================================\n // HELPER METHODS\n // ============================================================================\n\n private async ensureInitialized(): Promise<void> {\n if (!this.client) {\n await this.initialize();\n }\n }\n\n /**\n * Map a WorkOS `User` to the framework-standard `StandardUserInfo`.\n * WorkOS exposes `firstName`/`lastName` as `string | null`; we normalize null → undefined.\n */\n private mapWorkOSUserToStandard(user: User): StandardUserInfo {\n const fullName = [user.firstName, user.lastName].filter(Boolean).join(' ');\n return {\n id: user.id,\n email: user.email,\n name: fullName || user.email,\n givenName: user.firstName ?? undefined,\n familyName: user.lastName ?? undefined,\n preferredUsername: user.email,\n pictureUrl: user.profilePictureUrl ?? undefined,\n emailVerified: user.emailVerified\n };\n }\n\n // ============================================================================\n // CONFIGURATION\n // ============================================================================\n\n override getRequiredConfig(): string[] {\n return ['clientId'];\n }\n\n override validateConfig(config: Record<string, unknown>): boolean {\n // The real config arrives via the 'workosConfig' injection token; the only hard\n // requirement is a clientId.\n return !!this.workosConfig?.clientId || !!config['clientId'];\n }\n}\n"]}
|
|
@@ -8,7 +8,11 @@ import * as i0 from "@angular/core";
|
|
|
8
8
|
export declare class RedirectComponent implements OnInit {
|
|
9
9
|
private authService;
|
|
10
10
|
private cdr;
|
|
11
|
-
|
|
11
|
+
IsProcessing: boolean;
|
|
12
|
+
/** @deprecated Use {@link IsProcessing}. */
|
|
13
|
+
get isProcessing(): boolean;
|
|
14
|
+
/** @deprecated Use {@link IsProcessing}. */
|
|
15
|
+
set isProcessing(value: boolean);
|
|
12
16
|
constructor(authService: MJAuthBase, cdr: ChangeDetectorRef);
|
|
13
17
|
ngOnInit(): Promise<void>;
|
|
14
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<RedirectComponent, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirect.component.d.ts","sourceRoot":"","sources":["../../src/lib/redirect.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAA2B,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;;AAE5D;;;GAGG;AACH,qBAea,iBAAkB,YAAW,MAAM;
|
|
1
|
+
{"version":3,"file":"redirect.component.d.ts","sourceRoot":"","sources":["../../src/lib/redirect.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAA2B,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;;AAE5D;;;GAGG;AACH,qBAea,iBAAkB,YAAW,MAAM;IAa5C,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,GAAG;IAbb,YAAY,UAAS;IAErB,4CAA4C;IAC5C,IAAI,YAAY,YAEf;IACD,4CAA4C;IAC5C,IAAI,YAAY,CAAC,KAAK,SAAA,EAErB;gBAGS,WAAW,EAAE,UAAU,EACvB,GAAG,EAAE,iBAAiB;IAG1B,QAAQ;yCAjBH,iBAAiB;2CAAjB,iBAAiB;CA6C7B"}
|
|
@@ -16,7 +16,15 @@ function RedirectComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
16
16
|
export class RedirectComponent {
|
|
17
17
|
authService;
|
|
18
18
|
cdr;
|
|
19
|
-
|
|
19
|
+
IsProcessing = false;
|
|
20
|
+
/** @deprecated Use {@link IsProcessing}. */
|
|
21
|
+
get isProcessing() {
|
|
22
|
+
return this.IsProcessing;
|
|
23
|
+
}
|
|
24
|
+
/** @deprecated Use {@link IsProcessing}. */
|
|
25
|
+
set isProcessing(value) {
|
|
26
|
+
this.IsProcessing = value;
|
|
27
|
+
}
|
|
20
28
|
constructor(authService, cdr) {
|
|
21
29
|
this.authService = authService;
|
|
22
30
|
this.cdr = cdr;
|
|
@@ -33,7 +41,7 @@ export class RedirectComponent {
|
|
|
33
41
|
// the main application auth (MSAL/Azure AD).
|
|
34
42
|
const isMCPOAuthCallback = window.location.pathname.startsWith('/oauth/callback');
|
|
35
43
|
if (hasAuthCode && !isMCPOAuthCallback) {
|
|
36
|
-
this.
|
|
44
|
+
this.IsProcessing = true;
|
|
37
45
|
this.cdr.markForCheck();
|
|
38
46
|
try {
|
|
39
47
|
// Handle the callback for the current auth provider
|
|
@@ -44,7 +52,7 @@ export class RedirectComponent {
|
|
|
44
52
|
}
|
|
45
53
|
finally {
|
|
46
54
|
// Always hide the component after processing
|
|
47
|
-
this.
|
|
55
|
+
this.IsProcessing = false;
|
|
48
56
|
this.cdr.markForCheck();
|
|
49
57
|
}
|
|
50
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirect.component.js","sourceRoot":"","sources":["../../src/lib/redirect.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,uBAAuB,EAAqB,MAAM,eAAe,CAAC;;;;IAepF,AADF,AADF,8BAAyF,aACtD,SAC3B;IAAA,4CAA4B;IAAA,iBAAK;IACrC,yBAAG;IAAA,yDAAyC;IAEhD,AADE,AAD8C,iBAAI,EAC5C,EACF;;AAfZ;;;GAGG;AAgBH,MAAM,OAAO,iBAAiB;
|
|
1
|
+
{"version":3,"file":"redirect.component.js","sourceRoot":"","sources":["../../src/lib/redirect.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,uBAAuB,EAAqB,MAAM,eAAe,CAAC;;;;IAepF,AADF,AADF,8BAAyF,aACtD,SAC3B;IAAA,4CAA4B;IAAA,iBAAK;IACrC,yBAAG;IAAA,yDAAyC;IAEhD,AADE,AAD8C,iBAAI,EAC5C,EACF;;AAfZ;;;GAGG;AAgBH,MAAM,OAAO,iBAAiB;IAalB;IACA;IAbV,YAAY,GAAG,KAAK,CAAC;IAErB,4CAA4C;IAC5C,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IACD,4CAA4C;IAC5C,IAAI,YAAY,CAAC,KAAK;QACpB,IAAI,CAAC,YAAY,GAAG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S;eAAC;gBACT,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,cAAc;gBACxB,eAAe,EAAE,uBAAuB,CAAC,MAAM;gBAC/C,QAAQ,EAAE;;;;;;;;;KASP;aACJ;;kFACY,iBAAiB","sourcesContent":["import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';\nimport { MJAuthBase } from './mjexplorer-auth-base.service';\n\n/**\n * Generic redirect component that handles OAuth callbacks for all providers\n * This replaces the MSAL-specific redirect component to work with any auth provider\n */\n@Component({\n standalone: false,\n selector: 'app-redirect',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (isProcessing) {\n <div style=\"display: flex; justify-content: center; align-items: center; height: 100vh;\">\n <div style=\"text-align: center;\">\n <h2>Processing authentication...</h2>\n <p>Please wait while we complete your login.</p>\n </div>\n </div>\n }\n `\n})\nexport class RedirectComponent implements OnInit {\n IsProcessing = false;\n\n /** @deprecated Use {@link IsProcessing}. */\n get isProcessing() {\n return this.IsProcessing;\n }\n /** @deprecated Use {@link IsProcessing}. */\n set isProcessing(value) {\n this.IsProcessing = value;\n }\n\n constructor(\n private authService: MJAuthBase,\n private cdr: ChangeDetectorRef\n ) {}\n\n async ngOnInit() {\n // Only show the processing message if we're actually handling an auth redirect\n // Check for auth codes in the URL that indicate we're in a redirect flow\n const hasAuthCode = window.location.hash.includes('code=') ||\n window.location.hash.includes('id_token=') ||\n window.location.search.includes('code=') ||\n window.location.search.includes('state=');\n\n // Don't handle MCP OAuth callbacks - those go to /oauth/callback and are handled\n // by the OAuthCallbackComponent in explorer-core. This component only handles\n // the main application auth (MSAL/Azure AD).\n const isMCPOAuthCallback = window.location.pathname.startsWith('/oauth/callback');\n\n if (hasAuthCode && !isMCPOAuthCallback) {\n this.IsProcessing = true;\n this.cdr.markForCheck();\n try {\n // Handle the callback for the current auth provider\n await this.authService.handleCallback();\n } catch (error) {\n console.error('Error handling auth callback:', error);\n } finally {\n // Always hide the component after processing\n this.IsProcessing = false;\n this.cdr.markForCheck();\n }\n }\n }\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-auth-services",
|
|
3
|
-
"version": "6.2.0-edge.
|
|
3
|
+
"version": "6.2.0-edge.2",
|
|
4
4
|
"description": "MemberJunction Explorer: Authentication Services",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@auth0/auth0-spa-js": "^2.14.0",
|
|
31
|
-
"@memberjunction/core": "6.2.0-edge.
|
|
32
|
-
"@memberjunction/global": "6.2.0-edge.
|
|
33
|
-
"@memberjunction/ng-ui-components": "6.2.0-edge.
|
|
31
|
+
"@memberjunction/core": "6.2.0-edge.2",
|
|
32
|
+
"@memberjunction/global": "6.2.0-edge.2",
|
|
33
|
+
"@memberjunction/ng-ui-components": "6.2.0-edge.2",
|
|
34
34
|
"rxjs": "^7.8.2",
|
|
35
35
|
"tslib": "^2.8.1"
|
|
36
36
|
},
|