@memberjunction/ng-auth-services 2.129.0 → 2.130.1
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/IAuthProvider.d.ts +179 -17
- package/dist/lib/IAuthProvider.d.ts.map +1 -1
- package/dist/lib/auth-types.d.ts +351 -0
- package/dist/lib/auth-types.d.ts.map +1 -0
- package/dist/lib/auth-types.js +98 -0
- package/dist/lib/auth-types.js.map +1 -0
- package/dist/lib/mjexplorer-auth-base.service.d.ts +225 -49
- package/dist/lib/mjexplorer-auth-base.service.d.ts.map +1 -1
- package/dist/lib/mjexplorer-auth-base.service.js +189 -54
- package/dist/lib/mjexplorer-auth-base.service.js.map +1 -1
- package/dist/lib/providers/mjexplorer-auth0-provider.service.d.ts +69 -17
- package/dist/lib/providers/mjexplorer-auth0-provider.service.d.ts.map +1 -1
- package/dist/lib/providers/mjexplorer-auth0-provider.service.js +255 -75
- package/dist/lib/providers/mjexplorer-auth0-provider.service.js.map +1 -1
- package/dist/lib/providers/mjexplorer-msal-provider.service.d.ts +65 -16
- package/dist/lib/providers/mjexplorer-msal-provider.service.d.ts.map +1 -1
- package/dist/lib/providers/mjexplorer-msal-provider.service.js +345 -113
- package/dist/lib/providers/mjexplorer-msal-provider.service.js.map +1 -1
- package/dist/lib/providers/mjexplorer-okta-provider.service.d.ts +63 -30
- package/dist/lib/providers/mjexplorer-okta-provider.service.d.ts.map +1 -1
- package/dist/lib/providers/mjexplorer-okta-provider.service.js +273 -234
- package/dist/lib/providers/mjexplorer-okta-provider.service.js.map +1 -1
- package/dist/public-api.d.ts +1 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +2 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { OnDestroy } from '@angular/core';
|
|
2
2
|
import { MJAuthBase } from '../mjexplorer-auth-base.service';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
3
|
import { MsalBroadcastService, MsalService, MsalGuard } from '@azure/msal-angular';
|
|
5
|
-
import { AccountInfo } from '@azure/msal-common';
|
|
6
4
|
import { PublicClientApplication, InteractionType } from '@azure/msal-browser';
|
|
5
|
+
import { StandardUserInfo, StandardAuthToken, StandardAuthError, TokenRefreshResult } from '../auth-types';
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
export declare function LoadMJMSALProvider(): void;
|
|
8
|
+
/**
|
|
9
|
+
* MSAL (Microsoft Authentication Library) provider implementation - v3.0.0
|
|
10
|
+
*
|
|
11
|
+
* Implements the abstract methods from MJAuthBase to hide MSAL-specific details.
|
|
12
|
+
* The key abstraction is that MSAL stores the JWT in AuthenticationResult.idToken,
|
|
13
|
+
* but consumers never need to know this detail.
|
|
14
|
+
*/
|
|
9
15
|
export declare class MJMSALProvider extends MJAuthBase implements OnDestroy {
|
|
10
16
|
auth: MsalService;
|
|
11
17
|
private msalBroadcastService;
|
|
12
18
|
static readonly PROVIDER_TYPE = "msal";
|
|
13
|
-
type
|
|
19
|
+
readonly type = "msal";
|
|
14
20
|
private readonly _destroying$;
|
|
15
21
|
private readonly _initializationCompleted$;
|
|
16
22
|
private _initPromise;
|
|
@@ -18,7 +24,7 @@ export declare class MJMSALProvider extends MJAuthBase implements OnDestroy {
|
|
|
18
24
|
* Factory function to provide Angular dependencies required by MSAL
|
|
19
25
|
* Stored as a static property for the factory to access without instantiation
|
|
20
26
|
*/
|
|
21
|
-
static angularProviderFactory: (environment:
|
|
27
|
+
static angularProviderFactory: (environment: Record<string, unknown>) => (typeof MsalService | typeof MsalBroadcastService | typeof MsalGuard | {
|
|
22
28
|
provide: import("@angular/core").InjectionToken<string>;
|
|
23
29
|
useValue: PublicClientApplication;
|
|
24
30
|
} | {
|
|
@@ -39,22 +45,65 @@ export declare class MJMSALProvider extends MJAuthBase implements OnDestroy {
|
|
|
39
45
|
};
|
|
40
46
|
})[];
|
|
41
47
|
constructor(auth: MsalService, msalBroadcastService: MsalBroadcastService);
|
|
42
|
-
|
|
48
|
+
initialize(): Promise<void>;
|
|
43
49
|
private _performInitialization;
|
|
44
|
-
|
|
45
|
-
login(options?: any): Observable<void>;
|
|
50
|
+
protected loginInternal(options?: Record<string, unknown>): Promise<void>;
|
|
46
51
|
logout(): Promise<void>;
|
|
47
|
-
refresh(): Promise<Observable<any>>;
|
|
48
|
-
getUser(): Promise<AccountInfo | null>;
|
|
49
|
-
isAuthenticated(): Observable<boolean>;
|
|
50
|
-
getUserClaims(): Promise<Observable<any>>;
|
|
51
|
-
checkExpiredTokenError(error: string): boolean;
|
|
52
|
-
initialize(): Promise<void>;
|
|
53
|
-
protected loginInternal(options?: any): Promise<void>;
|
|
54
|
-
getToken(): Promise<string | null>;
|
|
55
52
|
handleCallback(): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Extract ID token from MSAL's storage
|
|
55
|
+
*
|
|
56
|
+
* MSAL stores the JWT in AuthenticationResult.idToken
|
|
57
|
+
* This is the key abstraction - consumers never need to know about MSAL's structure!
|
|
58
|
+
*/
|
|
59
|
+
protected extractIdTokenInternal(): Promise<string | null>;
|
|
60
|
+
/**
|
|
61
|
+
* Extract complete token info from MSAL
|
|
62
|
+
*
|
|
63
|
+
* Maps MSAL's AuthenticationResult to StandardAuthToken
|
|
64
|
+
*/
|
|
65
|
+
protected extractTokenInfoInternal(): Promise<StandardAuthToken | null>;
|
|
66
|
+
/**
|
|
67
|
+
* Extract user info from MSAL account
|
|
68
|
+
*
|
|
69
|
+
* Maps MSAL's AccountInfo structure to StandardUserInfo
|
|
70
|
+
*/
|
|
71
|
+
protected extractUserInfoInternal(): Promise<StandardUserInfo | null>;
|
|
72
|
+
/**
|
|
73
|
+
* Refresh token using MSAL's silent token acquisition
|
|
74
|
+
*
|
|
75
|
+
* Uses acquireTokenSilent with forceRefresh to get new tokens
|
|
76
|
+
*/
|
|
77
|
+
protected refreshTokenInternal(): Promise<TokenRefreshResult>;
|
|
78
|
+
/**
|
|
79
|
+
* Classify MSAL-specific errors into semantic types
|
|
80
|
+
*
|
|
81
|
+
* Maps MSAL error classes to AuthErrorType enum
|
|
82
|
+
*/
|
|
83
|
+
protected classifyErrorInternal(error: unknown): StandardAuthError;
|
|
84
|
+
private ensureInitialized;
|
|
85
|
+
/**
|
|
86
|
+
* Map MSAL AccountInfo to StandardUserInfo
|
|
87
|
+
*/
|
|
88
|
+
private mapMSALAccountToStandard;
|
|
89
|
+
/**
|
|
90
|
+
* Get profile picture URL from Microsoft Graph API
|
|
91
|
+
*
|
|
92
|
+
* MSAL requires fetching the photo from Microsoft Graph.
|
|
93
|
+
* This is the key advantage of encapsulation - consumers don't need
|
|
94
|
+
* to know about Graph API, they just call getProfilePictureUrl()!
|
|
95
|
+
*/
|
|
96
|
+
protected getProfilePictureUrlInternal(): Promise<string | null>;
|
|
97
|
+
/**
|
|
98
|
+
* Handle session expiry by redirecting to Microsoft login
|
|
99
|
+
*
|
|
100
|
+
* This method is called by the base class when silent token refresh fails
|
|
101
|
+
* with INTERACTION_REQUIRED error. It redirects to Microsoft login and never returns.
|
|
102
|
+
* After authentication, the app will reload and re-initialize with a fresh token.
|
|
103
|
+
*/
|
|
104
|
+
protected handleSessionExpiryInternal(): Promise<void>;
|
|
56
105
|
getRequiredConfig(): string[];
|
|
57
|
-
validateConfig(_config:
|
|
106
|
+
validateConfig(_config: Record<string, unknown>): boolean;
|
|
58
107
|
ngOnDestroy(): void;
|
|
59
108
|
static ɵfac: i0.ɵɵFactoryDeclaration<MJMSALProvider, never>;
|
|
60
109
|
static ɵprov: i0.ɵɵInjectableDeclaration<MJMSALProvider>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mjexplorer-msal-provider.service.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/mjexplorer-msal-provider.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,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