@memberjunction/server 5.15.0 → 5.16.0
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/auth/index.d.ts +0 -3
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +5 -7
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/initializeProviders.js +2 -2
- package/dist/auth/initializeProviders.js.map +1 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +3 -3
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/dist/resolvers/DatasetResolver.d.ts +5 -0
- package/dist/resolvers/DatasetResolver.d.ts.map +1 -1
- package/dist/resolvers/DatasetResolver.js +35 -0
- package/dist/resolvers/DatasetResolver.js.map +1 -1
- package/package.json +60 -59
- package/src/__tests__/unifiedAuth.test.ts +3 -2
- package/src/auth/__tests__/backward-compatibility.test.ts +2 -3
- package/src/auth/index.ts +5 -8
- package/src/auth/initializeProviders.ts +2 -2
- package/src/context.ts +3 -3
- package/src/index.ts +21 -3
- package/src/resolvers/DatasetResolver.ts +36 -0
- package/dist/auth/AuthProviderFactory.d.ts +0 -68
- package/dist/auth/AuthProviderFactory.d.ts.map +0 -1
- package/dist/auth/AuthProviderFactory.js +0 -155
- package/dist/auth/AuthProviderFactory.js.map +0 -1
- package/dist/auth/BaseAuthProvider.d.ts +0 -41
- package/dist/auth/BaseAuthProvider.d.ts.map +0 -1
- package/dist/auth/BaseAuthProvider.js +0 -102
- package/dist/auth/BaseAuthProvider.js.map +0 -1
- package/dist/auth/IAuthProvider.d.ts +0 -46
- package/dist/auth/IAuthProvider.d.ts.map +0 -1
- package/dist/auth/IAuthProvider.js +0 -2
- package/dist/auth/IAuthProvider.js.map +0 -1
- package/dist/auth/providers/Auth0Provider.d.ts +0 -18
- package/dist/auth/providers/Auth0Provider.d.ts.map +0 -1
- package/dist/auth/providers/Auth0Provider.js +0 -52
- package/dist/auth/providers/Auth0Provider.js.map +0 -1
- package/dist/auth/providers/CognitoProvider.d.ts +0 -18
- package/dist/auth/providers/CognitoProvider.d.ts.map +0 -1
- package/dist/auth/providers/CognitoProvider.js +0 -56
- package/dist/auth/providers/CognitoProvider.js.map +0 -1
- package/dist/auth/providers/GoogleProvider.d.ts +0 -18
- package/dist/auth/providers/GoogleProvider.d.ts.map +0 -1
- package/dist/auth/providers/GoogleProvider.js +0 -51
- package/dist/auth/providers/GoogleProvider.js.map +0 -1
- package/dist/auth/providers/MSALProvider.d.ts +0 -18
- package/dist/auth/providers/MSALProvider.d.ts.map +0 -1
- package/dist/auth/providers/MSALProvider.js +0 -52
- package/dist/auth/providers/MSALProvider.js.map +0 -1
- package/dist/auth/providers/OktaProvider.d.ts +0 -18
- package/dist/auth/providers/OktaProvider.d.ts.map +0 -1
- package/dist/auth/providers/OktaProvider.js +0 -52
- package/dist/auth/providers/OktaProvider.js.map +0 -1
- package/dist/auth/tokenExpiredError.d.ts +0 -5
- package/dist/auth/tokenExpiredError.d.ts.map +0 -1
- package/dist/auth/tokenExpiredError.js +0 -12
- package/dist/auth/tokenExpiredError.js.map +0 -1
- package/src/auth/AuthProviderFactory.ts +0 -182
- package/src/auth/BaseAuthProvider.ts +0 -137
- package/src/auth/IAuthProvider.ts +0 -54
- package/src/auth/providers/Auth0Provider.ts +0 -45
- package/src/auth/providers/CognitoProvider.ts +0 -50
- package/src/auth/providers/GoogleProvider.ts +0 -45
- package/src/auth/providers/MSALProvider.ts +0 -45
- package/src/auth/providers/OktaProvider.ts +0 -46
- package/src/auth/tokenExpiredError.ts +0 -12
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { JwtHeader, JwtPayload, SigningKeyCallback } from 'jsonwebtoken';
|
|
2
|
-
import jwksClient from 'jwks-rsa';
|
|
3
|
-
import { AuthProviderConfig, AuthUserInfo } from '@memberjunction/core';
|
|
4
|
-
import { IAuthProvider } from './IAuthProvider.js';
|
|
5
|
-
/**
|
|
6
|
-
* Base implementation of IAuthProvider with common functionality
|
|
7
|
-
* Concrete providers should extend this class and use @RegisterClass decorator
|
|
8
|
-
* with BaseAuthProvider as the base class
|
|
9
|
-
*/
|
|
10
|
-
export declare abstract class BaseAuthProvider implements IAuthProvider {
|
|
11
|
-
name: string;
|
|
12
|
-
issuer: string;
|
|
13
|
-
audience: string;
|
|
14
|
-
jwksUri: string;
|
|
15
|
-
/** OAuth client ID for this provider (used by OAuth proxy for upstream auth) */
|
|
16
|
-
clientId?: string;
|
|
17
|
-
protected config: AuthProviderConfig;
|
|
18
|
-
protected jwksClient: jwksClient.JwksClient;
|
|
19
|
-
constructor(config: AuthProviderConfig);
|
|
20
|
-
/**
|
|
21
|
-
* Validates that required configuration is present
|
|
22
|
-
*/
|
|
23
|
-
validateConfig(): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Gets the signing key for token verification with retry logic
|
|
26
|
-
*/
|
|
27
|
-
getSigningKey(header: JwtHeader, callback: SigningKeyCallback): void;
|
|
28
|
-
/**
|
|
29
|
-
* Retrieves signing key with exponential backoff retry logic
|
|
30
|
-
*/
|
|
31
|
-
private getSigningKeyWithRetry;
|
|
32
|
-
/**
|
|
33
|
-
* Checks if a given issuer URL belongs to this provider
|
|
34
|
-
*/
|
|
35
|
-
matchesIssuer(issuer: string): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Abstract method for extracting user info - must be implemented by each provider
|
|
38
|
-
*/
|
|
39
|
-
abstract extractUserInfo(payload: JwtPayload): AuthUserInfo;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=BaseAuthProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAuthProvider.d.ts","sourceRoot":"","sources":["../../src/auth/BaseAuthProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,UAAU,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAInD;;;;GAIG;AACH,8BAAsB,gBAAiB,YAAW,aAAa;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACrC,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC;gBAEhC,MAAM,EAAE,kBAAkB;IAoCtC;;OAEG;IACH,cAAc,IAAI,OAAO;IAIzB;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,GAAG,IAAI;IAYpE;;OAEG;YACW,sBAAsB;IAuCpC;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAOtC;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,YAAY;CAC5D"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import jwksClient from 'jwks-rsa';
|
|
2
|
-
import https from 'https';
|
|
3
|
-
import http from 'http';
|
|
4
|
-
/**
|
|
5
|
-
* Base implementation of IAuthProvider with common functionality
|
|
6
|
-
* Concrete providers should extend this class and use @RegisterClass decorator
|
|
7
|
-
* with BaseAuthProvider as the base class
|
|
8
|
-
*/
|
|
9
|
-
export class BaseAuthProvider {
|
|
10
|
-
constructor(config) {
|
|
11
|
-
this.config = config;
|
|
12
|
-
this.name = config.name;
|
|
13
|
-
this.issuer = config.issuer;
|
|
14
|
-
this.audience = config.audience;
|
|
15
|
-
this.jwksUri = config.jwksUri;
|
|
16
|
-
this.clientId = config.clientId;
|
|
17
|
-
// Create HTTP agent with keep-alive to prevent socket hangups
|
|
18
|
-
const agent = this.jwksUri.startsWith('https')
|
|
19
|
-
? new https.Agent({
|
|
20
|
-
keepAlive: true,
|
|
21
|
-
keepAliveMsecs: 30000,
|
|
22
|
-
maxSockets: 50,
|
|
23
|
-
maxFreeSockets: 10,
|
|
24
|
-
timeout: 60000
|
|
25
|
-
})
|
|
26
|
-
: new http.Agent({
|
|
27
|
-
keepAlive: true,
|
|
28
|
-
keepAliveMsecs: 30000,
|
|
29
|
-
maxSockets: 50,
|
|
30
|
-
maxFreeSockets: 10,
|
|
31
|
-
timeout: 60000
|
|
32
|
-
});
|
|
33
|
-
// Initialize JWKS client with connection pooling and extended timeout
|
|
34
|
-
this.jwksClient = jwksClient({
|
|
35
|
-
jwksUri: this.jwksUri,
|
|
36
|
-
cache: true,
|
|
37
|
-
cacheMaxEntries: 5,
|
|
38
|
-
cacheMaxAge: 600000, // 10 minutes
|
|
39
|
-
timeout: 60000, // 60 seconds (increased from default 30s)
|
|
40
|
-
requestAgent: agent
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Validates that required configuration is present
|
|
45
|
-
*/
|
|
46
|
-
validateConfig() {
|
|
47
|
-
return !!(this.name && this.issuer && this.audience && this.jwksUri);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Gets the signing key for token verification with retry logic
|
|
51
|
-
*/
|
|
52
|
-
getSigningKey(header, callback) {
|
|
53
|
-
this.getSigningKeyWithRetry(header, 3, 1000)
|
|
54
|
-
.then((key) => {
|
|
55
|
-
const signingKey = 'publicKey' in key ? key.publicKey : key.rsaPublicKey;
|
|
56
|
-
callback(null, signingKey);
|
|
57
|
-
})
|
|
58
|
-
.catch((err) => {
|
|
59
|
-
console.error(`Error getting signing key for provider ${this.name} after retries:`, err);
|
|
60
|
-
callback(err);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Retrieves signing key with exponential backoff retry logic
|
|
65
|
-
*/
|
|
66
|
-
async getSigningKeyWithRetry(header, maxRetries, initialDelayMs) {
|
|
67
|
-
let lastError;
|
|
68
|
-
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
69
|
-
try {
|
|
70
|
-
return await this.jwksClient.getSigningKey(header.kid);
|
|
71
|
-
}
|
|
72
|
-
catch (err) {
|
|
73
|
-
lastError = err instanceof Error ? err : new Error(String(err));
|
|
74
|
-
// Check if this is a connection error that's worth retrying
|
|
75
|
-
const isRetryableError = lastError.message.includes('socket hang up') ||
|
|
76
|
-
lastError.message.includes('ECONNRESET') ||
|
|
77
|
-
lastError.message.includes('ETIMEDOUT') ||
|
|
78
|
-
lastError.message.includes('ENOTFOUND') ||
|
|
79
|
-
lastError.message.includes('EAI_AGAIN');
|
|
80
|
-
if (!isRetryableError || attempt === maxRetries) {
|
|
81
|
-
throw lastError;
|
|
82
|
-
}
|
|
83
|
-
// Exponential backoff: wait longer between each retry
|
|
84
|
-
const delayMs = initialDelayMs * Math.pow(2, attempt);
|
|
85
|
-
console.warn(`Attempt ${attempt + 1}/${maxRetries + 1} failed for provider ${this.name}. ` +
|
|
86
|
-
`Retrying in ${delayMs}ms... Error: ${lastError.message}`);
|
|
87
|
-
await new Promise(resolve => setTimeout(resolve, delayMs));
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
throw lastError || new Error('Failed to retrieve signing key');
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Checks if a given issuer URL belongs to this provider
|
|
94
|
-
*/
|
|
95
|
-
matchesIssuer(issuer) {
|
|
96
|
-
// Handle trailing slashes and case sensitivity
|
|
97
|
-
const normalizedIssuer = issuer.toLowerCase().replace(/\/$/, '');
|
|
98
|
-
const normalizedProviderIssuer = this.issuer.toLowerCase().replace(/\/$/, '');
|
|
99
|
-
return normalizedIssuer === normalizedProviderIssuer;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-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,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC9E,OAAO,gBAAgB,KAAK,wBAAwB,CAAC;IACvD,CAAC;CAMF"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { JwtHeader, JwtPayload, SigningKeyCallback } from 'jsonwebtoken';
|
|
2
|
-
import { AuthUserInfo } from '@memberjunction/core';
|
|
3
|
-
/**
|
|
4
|
-
* Interface for authentication providers in MemberJunction
|
|
5
|
-
* Enables support for any OAuth 2.0/OIDC compliant provider
|
|
6
|
-
*/
|
|
7
|
-
export interface IAuthProvider {
|
|
8
|
-
/**
|
|
9
|
-
* Unique name identifier for this provider
|
|
10
|
-
*/
|
|
11
|
-
name: string;
|
|
12
|
-
/**
|
|
13
|
-
* The issuer URL for this provider (must match the 'iss' claim in tokens)
|
|
14
|
-
*/
|
|
15
|
-
issuer: string;
|
|
16
|
-
/**
|
|
17
|
-
* The expected audience for tokens from this provider
|
|
18
|
-
*/
|
|
19
|
-
audience: string;
|
|
20
|
-
/**
|
|
21
|
-
* The JWKS endpoint URL for retrieving signing keys
|
|
22
|
-
*/
|
|
23
|
-
jwksUri: string;
|
|
24
|
-
/**
|
|
25
|
-
* OAuth client ID for this provider (optional, used by OAuth proxy for upstream authentication)
|
|
26
|
-
*/
|
|
27
|
-
clientId?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Validates that the provider configuration is complete and valid
|
|
30
|
-
*/
|
|
31
|
-
validateConfig(): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Gets the signing key for token verification
|
|
34
|
-
*/
|
|
35
|
-
getSigningKey(header: JwtHeader, callback: SigningKeyCallback): void;
|
|
36
|
-
/**
|
|
37
|
-
* Extracts user information from the JWT payload
|
|
38
|
-
* Different providers use different claim names
|
|
39
|
-
*/
|
|
40
|
-
extractUserInfo(payload: JwtPayload): AuthUserInfo;
|
|
41
|
-
/**
|
|
42
|
-
* Checks if a given issuer URL belongs to this provider
|
|
43
|
-
*/
|
|
44
|
-
matchesIssuer(issuer: string): boolean;
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=IAuthProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IAuthProvider.d.ts","sourceRoot":"","sources":["../../src/auth/IAuthProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAsB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAExE;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,cAAc,IAAI,OAAO,CAAC;IAE1B;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAErE;;;OAGG;IACH,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,YAAY,CAAC;IAEnD;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CACxC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IAuthProvider.js","sourceRoot":"","sources":["../../src/auth/IAuthProvider.ts"],"names":[],"mappings":""}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { JwtPayload } from 'jsonwebtoken';
|
|
2
|
-
import { AuthProviderConfig, AuthUserInfo } from '@memberjunction/core';
|
|
3
|
-
import { BaseAuthProvider } from '../BaseAuthProvider.js';
|
|
4
|
-
/**
|
|
5
|
-
* Auth0 authentication provider implementation
|
|
6
|
-
*/
|
|
7
|
-
export declare class Auth0Provider extends BaseAuthProvider {
|
|
8
|
-
constructor(config: AuthProviderConfig);
|
|
9
|
-
/**
|
|
10
|
-
* Extracts user information from Auth0 JWT payload
|
|
11
|
-
*/
|
|
12
|
-
extractUserInfo(payload: JwtPayload): AuthUserInfo;
|
|
13
|
-
/**
|
|
14
|
-
* Validates Auth0-specific configuration
|
|
15
|
-
*/
|
|
16
|
-
validateConfig(): boolean;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=Auth0Provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Auth0Provider.d.ts","sourceRoot":"","sources":["../../../src/auth/providers/Auth0Provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;GAEG;AACH,qBACa,aAAc,SAAQ,gBAAgB;gBACrC,MAAM,EAAE,kBAAkB;IAItC;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,YAAY;IAiBlD;;OAEG;IACH,cAAc,IAAI,OAAO;CAO1B"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { RegisterClass } from '@memberjunction/global';
|
|
11
|
-
import { BaseAuthProvider } from '../BaseAuthProvider.js';
|
|
12
|
-
/**
|
|
13
|
-
* Auth0 authentication provider implementation
|
|
14
|
-
*/
|
|
15
|
-
let Auth0Provider = class Auth0Provider extends BaseAuthProvider {
|
|
16
|
-
constructor(config) {
|
|
17
|
-
super(config);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Extracts user information from Auth0 JWT payload
|
|
21
|
-
*/
|
|
22
|
-
extractUserInfo(payload) {
|
|
23
|
-
// Auth0 uses standard OIDC claims
|
|
24
|
-
const email = payload.email;
|
|
25
|
-
const fullName = payload.name;
|
|
26
|
-
const firstName = payload.given_name;
|
|
27
|
-
const lastName = payload.family_name;
|
|
28
|
-
const preferredUsername = payload.preferred_username || email;
|
|
29
|
-
return {
|
|
30
|
-
email,
|
|
31
|
-
firstName: firstName || fullName?.split(' ')[0],
|
|
32
|
-
lastName: lastName || fullName?.split(' ')[1] || fullName?.split(' ')[0],
|
|
33
|
-
fullName,
|
|
34
|
-
preferredUsername
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Validates Auth0-specific configuration
|
|
39
|
-
*/
|
|
40
|
-
validateConfig() {
|
|
41
|
-
const baseValid = super.validateConfig();
|
|
42
|
-
const hasClientId = !!this.config.clientId;
|
|
43
|
-
const hasDomain = !!this.config.domain;
|
|
44
|
-
return baseValid && hasClientId && hasDomain;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
Auth0Provider = __decorate([
|
|
48
|
-
RegisterClass(BaseAuthProvider, 'auth0'),
|
|
49
|
-
__metadata("design:paramtypes", [Object])
|
|
50
|
-
], Auth0Provider);
|
|
51
|
-
export { Auth0Provider };
|
|
52
|
-
//# sourceMappingURL=Auth0Provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-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C/C,CAAC;CACF,CAAA;AAnCY,aAAa;IADzB,aAAa,CAAC,gBAAgB,EAAE,OAAO,CAAC;;GAC5B,aAAa,CAmCzB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { JwtPayload } from 'jsonwebtoken';
|
|
2
|
-
import { AuthProviderConfig, AuthUserInfo } from '@memberjunction/core';
|
|
3
|
-
import { BaseAuthProvider } from '../BaseAuthProvider.js';
|
|
4
|
-
/**
|
|
5
|
-
* AWS Cognito authentication provider implementation
|
|
6
|
-
*/
|
|
7
|
-
export declare class CognitoProvider extends BaseAuthProvider {
|
|
8
|
-
constructor(config: AuthProviderConfig);
|
|
9
|
-
/**
|
|
10
|
-
* Extracts user information from Cognito JWT payload
|
|
11
|
-
*/
|
|
12
|
-
extractUserInfo(payload: JwtPayload): AuthUserInfo;
|
|
13
|
-
/**
|
|
14
|
-
* Validates Cognito-specific configuration
|
|
15
|
-
*/
|
|
16
|
-
validateConfig(): boolean;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=CognitoProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CognitoProvider.d.ts","sourceRoot":"","sources":["../../../src/auth/providers/CognitoProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D;;GAEG;AACH,qBACa,eAAgB,SAAQ,gBAAgB;gBACvC,MAAM,EAAE,kBAAkB;IAItC;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,YAAY;IAoBlD;;OAEG;IACH,cAAc,IAAI,OAAO;CAQ1B"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { RegisterClass } from '@memberjunction/global';
|
|
11
|
-
import { BaseAuthProvider } from '../BaseAuthProvider.js';
|
|
12
|
-
/**
|
|
13
|
-
* AWS Cognito authentication provider implementation
|
|
14
|
-
*/
|
|
15
|
-
let CognitoProvider = class CognitoProvider extends BaseAuthProvider {
|
|
16
|
-
constructor(config) {
|
|
17
|
-
super(config);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Extracts user information from Cognito JWT payload
|
|
21
|
-
*/
|
|
22
|
-
extractUserInfo(payload) {
|
|
23
|
-
// Cognito uses custom claims with 'cognito:' prefix for some fields
|
|
24
|
-
const email = payload.email ||
|
|
25
|
-
payload['cognito:username'];
|
|
26
|
-
const fullName = payload.name;
|
|
27
|
-
const firstName = payload.given_name;
|
|
28
|
-
const lastName = payload.family_name;
|
|
29
|
-
const preferredUsername = payload['cognito:username'] ||
|
|
30
|
-
payload.preferred_username ||
|
|
31
|
-
email;
|
|
32
|
-
return {
|
|
33
|
-
email,
|
|
34
|
-
firstName: firstName || fullName?.split(' ')[0],
|
|
35
|
-
lastName: lastName || fullName?.split(' ')[1] || fullName?.split(' ')[0],
|
|
36
|
-
fullName,
|
|
37
|
-
preferredUsername
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Validates Cognito-specific configuration
|
|
42
|
-
*/
|
|
43
|
-
validateConfig() {
|
|
44
|
-
const baseValid = super.validateConfig();
|
|
45
|
-
const hasClientId = !!this.config.clientId;
|
|
46
|
-
const hasRegion = !!this.config.region;
|
|
47
|
-
const hasUserPoolId = !!this.config.userPoolId;
|
|
48
|
-
return baseValid && hasClientId && hasRegion && hasUserPoolId;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
CognitoProvider = __decorate([
|
|
52
|
-
RegisterClass(BaseAuthProvider, 'cognito'),
|
|
53
|
-
__metadata("design:paramtypes", [Object])
|
|
54
|
-
], CognitoProvider);
|
|
55
|
-
export { CognitoProvider };
|
|
56
|
-
//# sourceMappingURL=CognitoProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CognitoProvider.js","sourceRoot":"","sources":["../../../src/auth/providers/CognitoProvider.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D;;GAEG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,gBAAgB;IACnD,YAAY,MAA0B;QACpC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,OAAmB;QACjC,oEAAoE;QACpE,MAAM,KAAK,GAAG,OAAO,CAAC,KAA2B;YACnC,OAAO,CAAC,kBAAkB,CAAuB,CAAC;QAChE,MAAM,QAAQ,GAAG,OAAO,CAAC,IAA0B,CAAC;QACpD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAgC,CAAC;QAC3D,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAiC,CAAC;QAC3D,MAAM,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAuB;YAClD,OAAO,CAAC,kBAAwC;YAChD,KAAK,CAAC;QAE/B,OAAO;YACL,KAAK;YACL,SAAS,EAAE,SAAS,IAAI,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC/C,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACxE,QAAQ;YACR,iBAAiB;SAClB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;QACzC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC3C,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QACvC,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;QAE/C,OAAO,SAAS,IAAI,WAAW,IAAI,SAAS,IAAI,aAAa,CAAC;IAChE,CAAC;CACF,CAAA;AAvCY,eAAe;IAD3B,aAAa,CAAC,gBAAgB,EAAE,SAAS,CAAC;;GAC9B,eAAe,CAuC3B"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { JwtPayload } from 'jsonwebtoken';
|
|
2
|
-
import { AuthProviderConfig, AuthUserInfo } from '@memberjunction/core';
|
|
3
|
-
import { BaseAuthProvider } from '../BaseAuthProvider.js';
|
|
4
|
-
/**
|
|
5
|
-
* Google Identity Platform authentication provider implementation
|
|
6
|
-
*/
|
|
7
|
-
export declare class GoogleProvider extends BaseAuthProvider {
|
|
8
|
-
constructor(config: AuthProviderConfig);
|
|
9
|
-
/**
|
|
10
|
-
* Extracts user information from Google JWT payload
|
|
11
|
-
*/
|
|
12
|
-
extractUserInfo(payload: JwtPayload): AuthUserInfo;
|
|
13
|
-
/**
|
|
14
|
-
* Validates Google-specific configuration
|
|
15
|
-
*/
|
|
16
|
-
validateConfig(): boolean;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=GoogleProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleProvider.d.ts","sourceRoot":"","sources":["../../../src/auth/providers/GoogleProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D;;GAEG;AACH,qBACa,cAAe,SAAQ,gBAAgB;gBACtC,MAAM,EAAE,kBAAkB;IAItC;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,YAAY;IAiBlD;;OAEG;IACH,cAAc,IAAI,OAAO;CAM1B"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { RegisterClass } from '@memberjunction/global';
|
|
11
|
-
import { BaseAuthProvider } from '../BaseAuthProvider.js';
|
|
12
|
-
/**
|
|
13
|
-
* Google Identity Platform authentication provider implementation
|
|
14
|
-
*/
|
|
15
|
-
let GoogleProvider = class GoogleProvider extends BaseAuthProvider {
|
|
16
|
-
constructor(config) {
|
|
17
|
-
super(config);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Extracts user information from Google JWT payload
|
|
21
|
-
*/
|
|
22
|
-
extractUserInfo(payload) {
|
|
23
|
-
// Google uses standard OIDC claims
|
|
24
|
-
const email = payload.email;
|
|
25
|
-
const fullName = payload.name;
|
|
26
|
-
const firstName = payload.given_name;
|
|
27
|
-
const lastName = payload.family_name;
|
|
28
|
-
const preferredUsername = email; // Google typically uses email as username
|
|
29
|
-
return {
|
|
30
|
-
email,
|
|
31
|
-
firstName: firstName || fullName?.split(' ')[0],
|
|
32
|
-
lastName: lastName || fullName?.split(' ')[1] || fullName?.split(' ')[0],
|
|
33
|
-
fullName,
|
|
34
|
-
preferredUsername
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Validates Google-specific configuration
|
|
39
|
-
*/
|
|
40
|
-
validateConfig() {
|
|
41
|
-
const baseValid = super.validateConfig();
|
|
42
|
-
const hasClientId = !!this.config.clientId;
|
|
43
|
-
return baseValid && hasClientId;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
GoogleProvider = __decorate([
|
|
47
|
-
RegisterClass(BaseAuthProvider, 'google'),
|
|
48
|
-
__metadata("design:paramtypes", [Object])
|
|
49
|
-
], GoogleProvider);
|
|
50
|
-
export { GoogleProvider };
|
|
51
|
-
//# sourceMappingURL=GoogleProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleProvider.js","sourceRoot":"","sources":["../../../src/auth/providers/GoogleProvider.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D;;GAEG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,gBAAgB;IAClD,YAAY,MAA0B;QACpC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,OAAmB;QACjC,mCAAmC;QACnC,MAAM,KAAK,GAAG,OAAO,CAAC,KAA2B,CAAC;QAClD,MAAM,QAAQ,GAAG,OAAO,CAAC,IAA0B,CAAC;QACpD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAgC,CAAC;QAC3D,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAiC,CAAC;QAC3D,MAAM,iBAAiB,GAAG,KAAK,CAAC,CAAC,0CAA0C;QAE3E,OAAO;YACL,KAAK;YACL,SAAS,EAAE,SAAS,IAAI,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC/C,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACxE,QAAQ;YACR,iBAAiB;SAClB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;QACzC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QAE3C,OAAO,SAAS,IAAI,WAAW,CAAC;IAClC,CAAC;CACF,CAAA;AAlCY,cAAc;IAD1B,aAAa,CAAC,gBAAgB,EAAE,QAAQ,CAAC;;GAC7B,cAAc,CAkC1B"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { JwtPayload } from 'jsonwebtoken';
|
|
2
|
-
import { AuthProviderConfig, AuthUserInfo } from '@memberjunction/core';
|
|
3
|
-
import { BaseAuthProvider } from '../BaseAuthProvider.js';
|
|
4
|
-
/**
|
|
5
|
-
* Microsoft Authentication Library (MSAL) provider implementation
|
|
6
|
-
*/
|
|
7
|
-
export declare class MSALProvider extends BaseAuthProvider {
|
|
8
|
-
constructor(config: AuthProviderConfig);
|
|
9
|
-
/**
|
|
10
|
-
* Extracts user information from MSAL/Azure AD JWT payload
|
|
11
|
-
*/
|
|
12
|
-
extractUserInfo(payload: JwtPayload): AuthUserInfo;
|
|
13
|
-
/**
|
|
14
|
-
* Validates MSAL-specific configuration
|
|
15
|
-
*/
|
|
16
|
-
validateConfig(): boolean;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=MSALProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MSALProvider.d.ts","sourceRoot":"","sources":["../../../src/auth/providers/MSALProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;GAEG;AACH,qBACa,YAAa,SAAQ,gBAAgB;gBACpC,MAAM,EAAE,kBAAkB;IAItC;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,YAAY;IAiBlD;;OAEG;IACH,cAAc,IAAI,OAAO;CAO1B"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { RegisterClass } from '@memberjunction/global';
|
|
11
|
-
import { BaseAuthProvider } from '../BaseAuthProvider.js';
|
|
12
|
-
/**
|
|
13
|
-
* Microsoft Authentication Library (MSAL) provider implementation
|
|
14
|
-
*/
|
|
15
|
-
let MSALProvider = class MSALProvider extends BaseAuthProvider {
|
|
16
|
-
constructor(config) {
|
|
17
|
-
super(config);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Extracts user information from MSAL/Azure AD JWT payload
|
|
21
|
-
*/
|
|
22
|
-
extractUserInfo(payload) {
|
|
23
|
-
// MSAL/Azure AD uses some custom claims
|
|
24
|
-
const email = payload.email || payload.preferred_username;
|
|
25
|
-
const fullName = payload.name;
|
|
26
|
-
const firstName = payload.given_name;
|
|
27
|
-
const lastName = payload.family_name;
|
|
28
|
-
const preferredUsername = payload.preferred_username;
|
|
29
|
-
return {
|
|
30
|
-
email,
|
|
31
|
-
firstName: firstName || fullName?.split(' ')[0],
|
|
32
|
-
lastName: lastName || fullName?.split(' ')[1] || fullName?.split(' ')[0],
|
|
33
|
-
fullName,
|
|
34
|
-
preferredUsername
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Validates MSAL-specific configuration
|
|
39
|
-
*/
|
|
40
|
-
validateConfig() {
|
|
41
|
-
const baseValid = super.validateConfig();
|
|
42
|
-
const hasClientId = !!this.config.clientId;
|
|
43
|
-
const hasTenantId = !!this.config.tenantId;
|
|
44
|
-
return baseValid && hasClientId && hasTenantId;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
MSALProvider = __decorate([
|
|
48
|
-
RegisterClass(BaseAuthProvider, 'msal'),
|
|
49
|
-
__metadata("design:paramtypes", [Object])
|
|
50
|
-
], MSALProvider);
|
|
51
|
-
export { MSALProvider };
|
|
52
|
-
//# sourceMappingURL=MSALProvider.js.map
|
|
@@ -1 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AS,IAAI,WAAW,IAAI,WAAW,CAAC;IACjD,CAAC;CACF,CAAA;AAnCY,YAAY;IADxB,aAAa,CAAC,gBAAgB,EAAE,MAAM,CAAC;;GAC3B,YAAY,CAmCxB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { JwtPayload } from 'jsonwebtoken';
|
|
2
|
-
import { AuthProviderConfig, AuthUserInfo } from '@memberjunction/core';
|
|
3
|
-
import { BaseAuthProvider } from '../BaseAuthProvider.js';
|
|
4
|
-
/**
|
|
5
|
-
* Okta authentication provider implementation
|
|
6
|
-
*/
|
|
7
|
-
export declare class OktaProvider extends BaseAuthProvider {
|
|
8
|
-
constructor(config: AuthProviderConfig);
|
|
9
|
-
/**
|
|
10
|
-
* Extracts user information from Okta JWT payload
|
|
11
|
-
*/
|
|
12
|
-
extractUserInfo(payload: JwtPayload): AuthUserInfo;
|
|
13
|
-
/**
|
|
14
|
-
* Validates Okta-specific configuration
|
|
15
|
-
*/
|
|
16
|
-
validateConfig(): boolean;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=OktaProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OktaProvider.d.ts","sourceRoot":"","sources":["../../../src/auth/providers/OktaProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D;;GAEG;AACH,qBACa,YAAa,SAAQ,gBAAgB;gBACpC,MAAM,EAAE,kBAAkB;IAItC;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,YAAY;IAiBlD;;OAEG;IACH,cAAc,IAAI,OAAO;CAO1B"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { RegisterClass } from '@memberjunction/global';
|
|
11
|
-
import { BaseAuthProvider } from '../BaseAuthProvider.js';
|
|
12
|
-
/**
|
|
13
|
-
* Okta authentication provider implementation
|
|
14
|
-
*/
|
|
15
|
-
let OktaProvider = class OktaProvider extends BaseAuthProvider {
|
|
16
|
-
constructor(config) {
|
|
17
|
-
super(config);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Extracts user information from Okta JWT payload
|
|
21
|
-
*/
|
|
22
|
-
extractUserInfo(payload) {
|
|
23
|
-
// Okta uses standard OIDC claims plus some custom ones
|
|
24
|
-
const email = payload.email || payload.preferred_username;
|
|
25
|
-
const fullName = payload.name;
|
|
26
|
-
const firstName = payload.given_name;
|
|
27
|
-
const lastName = payload.family_name;
|
|
28
|
-
const preferredUsername = payload.preferred_username || email;
|
|
29
|
-
return {
|
|
30
|
-
email,
|
|
31
|
-
firstName: firstName || fullName?.split(' ')[0],
|
|
32
|
-
lastName: lastName || fullName?.split(' ')[1] || fullName?.split(' ')[0],
|
|
33
|
-
fullName,
|
|
34
|
-
preferredUsername
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Validates Okta-specific configuration
|
|
39
|
-
*/
|
|
40
|
-
validateConfig() {
|
|
41
|
-
const baseValid = super.validateConfig();
|
|
42
|
-
const hasClientId = !!this.config.clientId;
|
|
43
|
-
const hasDomain = !!this.config.domain;
|
|
44
|
-
return baseValid && hasClientId && hasDomain;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
OktaProvider = __decorate([
|
|
48
|
-
RegisterClass(BaseAuthProvider, 'okta'),
|
|
49
|
-
__metadata("design:paramtypes", [Object])
|
|
50
|
-
], OktaProvider);
|
|
51
|
-
export { OktaProvider };
|
|
52
|
-
//# sourceMappingURL=OktaProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OktaProvider.js","sourceRoot":"","sources":["../../../src/auth/providers/OktaProvider.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D;;GAEG;AAEI,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,gBAAgB;IAChD,YAAY,MAA0B;QACpC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,OAAmB;QACjC,uDAAuD;QACvD,MAAM,KAAK,GAAG,OAAO,CAAC,KAA2B,IAAI,OAAO,CAAC,kBAAwC,CAAC;QACtG,MAAM,QAAQ,GAAG,OAAO,CAAC,IAA0B,CAAC;QACpD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAgC,CAAC;QAC3D,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAiC,CAAC;QAC3D,MAAM,iBAAiB,GAAG,OAAO,CAAC,kBAAwC,IAAI,KAAK,CAAC;QAEpF,OAAO;YACL,KAAK;YACL,SAAS,EAAE,SAAS,IAAI,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC/C,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAAE,KAAK,CAAC,GAAG,C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