@nauth-toolkit/social-facebook 0.1.14 → 0.1.17
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/nestjs/facebook-social-auth.module.d.ts +37 -0
- package/dist/nestjs/facebook-social-auth.module.d.ts.map +1 -1
- package/dist/nestjs/facebook-social-auth.module.js +48 -4
- package/dist/nestjs/facebook-social-auth.module.js.map +1 -1
- package/dist/nestjs/index.d.ts +5 -0
- package/dist/nestjs/index.d.ts.map +1 -1
- package/dist/nestjs/index.js +6 -0
- package/dist/nestjs/index.js.map +1 -1
- package/dist/src/dto/social-login.dto.d.ts +219 -0
- package/dist/src/dto/social-login.dto.d.ts.map +1 -1
- package/dist/src/dto/social-login.dto.js +219 -0
- package/dist/src/dto/social-login.dto.js.map +1 -1
- package/dist/src/facebook-oauth.client.d.ts +59 -0
- package/dist/src/facebook-oauth.client.d.ts.map +1 -1
- package/dist/src/facebook-oauth.client.js +66 -2
- package/dist/src/facebook-oauth.client.js.map +1 -1
- package/dist/src/facebook-social-auth.service.d.ts +59 -1
- package/dist/src/facebook-social-auth.service.d.ts.map +1 -1
- package/dist/src/facebook-social-auth.service.js +82 -3
- package/dist/src/facebook-social-auth.service.js.map +1 -1
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/token-verifier.service.d.ts +40 -0
- package/dist/src/token-verifier.service.d.ts.map +1 -1
- package/dist/src/token-verifier.service.js +44 -0
- package/dist/src/token-verifier.service.js.map +1 -1
- package/dist/src/verified-token-profile.interface.d.ts +21 -0
- package/dist/src/verified-token-profile.interface.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -11,14 +11,45 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SocialAccountsResponseDTO = exports.SocialLoginResponseDTO = exports.UnlinkSocialAccountDTO = exports.LinkSocialAccountDTO = exports.SocialCallbackDTO = exports.SocialLoginDTO = exports.SocialProvider = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
|
+
/**
|
|
15
|
+
* Social provider enum
|
|
16
|
+
*/
|
|
14
17
|
var SocialProvider;
|
|
15
18
|
(function (SocialProvider) {
|
|
16
19
|
SocialProvider["GOOGLE"] = "google";
|
|
17
20
|
SocialProvider["APPLE"] = "apple";
|
|
18
21
|
SocialProvider["FACEBOOK"] = "facebook";
|
|
19
22
|
})(SocialProvider || (exports.SocialProvider = SocialProvider = {}));
|
|
23
|
+
/**
|
|
24
|
+
* DTO for initiating social login
|
|
25
|
+
* Used to generate OAuth URLs for social providers
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* // Generate Google OAuth URL
|
|
30
|
+
* const dto = new SocialLoginDTO();
|
|
31
|
+
* dto.provider = 'google';
|
|
32
|
+
* dto.state = 'random-state-string';
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
20
35
|
class SocialLoginDTO {
|
|
36
|
+
/**
|
|
37
|
+
* Social provider name
|
|
38
|
+
* Must be one of the configured providers
|
|
39
|
+
*
|
|
40
|
+
* Validation:
|
|
41
|
+
* - Must be a valid SocialProvider enum value
|
|
42
|
+
*/
|
|
21
43
|
provider;
|
|
44
|
+
/**
|
|
45
|
+
* Optional state parameter for OAuth flow
|
|
46
|
+
* Used to prevent CSRF attacks and maintain state
|
|
47
|
+
* If not provided, a random state will be generated
|
|
48
|
+
*
|
|
49
|
+
* Validation:
|
|
50
|
+
* - Must be a string if present
|
|
51
|
+
* - Max 2000 characters (typical OAuth state length)
|
|
52
|
+
*/
|
|
22
53
|
state;
|
|
23
54
|
}
|
|
24
55
|
exports.SocialLoginDTO = SocialLoginDTO;
|
|
@@ -32,11 +63,63 @@ __decorate([
|
|
|
32
63
|
(0, class_validator_1.MaxLength)(2000, { message: 'State must not exceed 2000 characters' }),
|
|
33
64
|
__metadata("design:type", String)
|
|
34
65
|
], SocialLoginDTO.prototype, "state", void 0);
|
|
66
|
+
/**
|
|
67
|
+
* DTO for handling OAuth callback
|
|
68
|
+
* Used to process the authorization code from OAuth providers
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* // Handle Google OAuth callback
|
|
73
|
+
* const dto = new SocialCallbackDTO();
|
|
74
|
+
* dto.provider = 'google';
|
|
75
|
+
* dto.code = 'authorization-code-from-google';
|
|
76
|
+
* dto.state = 'state-from-initial-request';
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
35
79
|
class SocialCallbackDTO {
|
|
80
|
+
/**
|
|
81
|
+
* Social provider name
|
|
82
|
+
* Must match the provider used in the initial request
|
|
83
|
+
*
|
|
84
|
+
* Validation:
|
|
85
|
+
* - Must be a valid SocialProvider enum value
|
|
86
|
+
*/
|
|
36
87
|
provider;
|
|
88
|
+
/**
|
|
89
|
+
* Authorization code from OAuth provider
|
|
90
|
+
* This code is exchanged for access token and user info
|
|
91
|
+
*
|
|
92
|
+
* Validation:
|
|
93
|
+
* - Must be a string
|
|
94
|
+
* - Max 1000 characters (typical OAuth code length)
|
|
95
|
+
*/
|
|
37
96
|
code;
|
|
97
|
+
/**
|
|
98
|
+
* State parameter from OAuth flow
|
|
99
|
+
* Must match the state sent in the initial request
|
|
100
|
+
*
|
|
101
|
+
* Validation:
|
|
102
|
+
* - Must be a string
|
|
103
|
+
* - Max 500 characters (typical OAuth state length)
|
|
104
|
+
*/
|
|
38
105
|
state;
|
|
106
|
+
/**
|
|
107
|
+
* Optional error parameter from OAuth provider
|
|
108
|
+
* Used when user denies permission or other errors occur
|
|
109
|
+
*
|
|
110
|
+
* Validation:
|
|
111
|
+
* - Must be a string if present
|
|
112
|
+
* - Max 100 characters
|
|
113
|
+
*/
|
|
39
114
|
error;
|
|
115
|
+
/**
|
|
116
|
+
* Optional error description from OAuth provider
|
|
117
|
+
* Provides more details about the error
|
|
118
|
+
*
|
|
119
|
+
* Validation:
|
|
120
|
+
* - Must be a string if present
|
|
121
|
+
* - Max 500 characters
|
|
122
|
+
*/
|
|
40
123
|
error_description;
|
|
41
124
|
}
|
|
42
125
|
exports.SocialCallbackDTO = SocialCallbackDTO;
|
|
@@ -68,9 +151,45 @@ __decorate([
|
|
|
68
151
|
(0, class_validator_1.MaxLength)(500, { message: 'Error description must not exceed 500 characters' }),
|
|
69
152
|
__metadata("design:type", String)
|
|
70
153
|
], SocialCallbackDTO.prototype, "error_description", void 0);
|
|
154
|
+
/**
|
|
155
|
+
* DTO for linking social account to existing user
|
|
156
|
+
* Used when an authenticated user wants to link a social provider
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```typescript
|
|
160
|
+
* // Link Google account to current user
|
|
161
|
+
* const dto = new LinkSocialAccountDTO();
|
|
162
|
+
* dto.provider = 'google';
|
|
163
|
+
* dto.code = 'authorization-code-from-google';
|
|
164
|
+
* dto.state = 'state-from-initial-request';
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
71
167
|
class LinkSocialAccountDTO {
|
|
168
|
+
/**
|
|
169
|
+
* Social provider name
|
|
170
|
+
* Must be one of the configured providers
|
|
171
|
+
*
|
|
172
|
+
* Validation:
|
|
173
|
+
* - Must be a valid SocialProvider enum value
|
|
174
|
+
*/
|
|
72
175
|
provider;
|
|
176
|
+
/**
|
|
177
|
+
* Authorization code from OAuth provider
|
|
178
|
+
* This code is exchanged for access token and user info
|
|
179
|
+
*
|
|
180
|
+
* Validation:
|
|
181
|
+
* - Must be a string
|
|
182
|
+
* - Max 1000 characters (typical OAuth code length)
|
|
183
|
+
*/
|
|
73
184
|
code;
|
|
185
|
+
/**
|
|
186
|
+
* State parameter from OAuth flow
|
|
187
|
+
* Must match the state sent in the initial request
|
|
188
|
+
*
|
|
189
|
+
* Validation:
|
|
190
|
+
* - Must be a string
|
|
191
|
+
* - Max 500 characters (typical OAuth state length)
|
|
192
|
+
*/
|
|
74
193
|
state;
|
|
75
194
|
}
|
|
76
195
|
exports.LinkSocialAccountDTO = LinkSocialAccountDTO;
|
|
@@ -90,7 +209,25 @@ __decorate([
|
|
|
90
209
|
(0, class_validator_1.MaxLength)(500, { message: 'State must not exceed 500 characters' }),
|
|
91
210
|
__metadata("design:type", String)
|
|
92
211
|
], LinkSocialAccountDTO.prototype, "state", void 0);
|
|
212
|
+
/**
|
|
213
|
+
* DTO for unlinking social account
|
|
214
|
+
* Used when an authenticated user wants to remove a social provider
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* // Unlink Google account from current user
|
|
219
|
+
* const dto = new UnlinkSocialAccountDTO();
|
|
220
|
+
* dto.provider = 'google';
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
93
223
|
class UnlinkSocialAccountDTO {
|
|
224
|
+
/**
|
|
225
|
+
* Social provider name to unlink
|
|
226
|
+
* Must be one of the currently linked providers
|
|
227
|
+
*
|
|
228
|
+
* Validation:
|
|
229
|
+
* - Must be a valid SocialProvider enum value
|
|
230
|
+
*/
|
|
94
231
|
provider;
|
|
95
232
|
}
|
|
96
233
|
exports.UnlinkSocialAccountDTO = UnlinkSocialAccountDTO;
|
|
@@ -98,11 +235,71 @@ __decorate([
|
|
|
98
235
|
(0, class_validator_1.IsEnum)(SocialProvider, { message: 'Provider must be one of: google, apple, facebook' }),
|
|
99
236
|
__metadata("design:type", String)
|
|
100
237
|
], UnlinkSocialAccountDTO.prototype, "provider", void 0);
|
|
238
|
+
/**
|
|
239
|
+
* Response DTO for social login
|
|
240
|
+
* Contains authentication tokens and user information
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```typescript
|
|
244
|
+
* // Response after successful social login
|
|
245
|
+
* {
|
|
246
|
+
* "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
247
|
+
* "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
248
|
+
* "expiresIn": 900,
|
|
249
|
+
* "user": {
|
|
250
|
+
* "sub": "user-uuid",
|
|
251
|
+
* "email": "user@example.com",
|
|
252
|
+
* "firstName": "John",
|
|
253
|
+
* "lastName": "Doe",
|
|
254
|
+
* "isEmailVerified": true,
|
|
255
|
+
* "socialProviders": ["google"]
|
|
256
|
+
* }
|
|
257
|
+
* }
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
101
260
|
class SocialLoginResponseDTO {
|
|
261
|
+
/**
|
|
262
|
+
* JWT access token for API authentication
|
|
263
|
+
*
|
|
264
|
+
* Validation:
|
|
265
|
+
* - Must be a string
|
|
266
|
+
* - Max 2048 characters (typical JWT length)
|
|
267
|
+
*/
|
|
102
268
|
accessToken;
|
|
269
|
+
/**
|
|
270
|
+
* JWT refresh token for token renewal
|
|
271
|
+
*
|
|
272
|
+
* Validation:
|
|
273
|
+
* - Must be a string
|
|
274
|
+
* - Max 2048 characters (typical JWT length)
|
|
275
|
+
*/
|
|
103
276
|
refreshToken;
|
|
277
|
+
/**
|
|
278
|
+
* Access token expiration timestamp (Unix timestamp in seconds)
|
|
279
|
+
*
|
|
280
|
+
* Validation:
|
|
281
|
+
* - Must be a number
|
|
282
|
+
*/
|
|
104
283
|
accessTokenExpiresAt;
|
|
284
|
+
/**
|
|
285
|
+
* Refresh token expiration timestamp (Unix timestamp in seconds)
|
|
286
|
+
*
|
|
287
|
+
* Validation:
|
|
288
|
+
* - Must be a number
|
|
289
|
+
*/
|
|
105
290
|
refreshTokenExpiresAt;
|
|
291
|
+
/**
|
|
292
|
+
* User information
|
|
293
|
+
*
|
|
294
|
+
* Validation:
|
|
295
|
+
* - Nested fields validated in service layer:
|
|
296
|
+
* - sub: UUID v4 format, max 36 chars
|
|
297
|
+
* - email: Valid email format, max 255 chars
|
|
298
|
+
* - firstName: String, max 100 chars
|
|
299
|
+
* - lastName: String, max 100 chars
|
|
300
|
+
* - isEmailVerified: Boolean
|
|
301
|
+
* - socialProviders: Array of strings, each max 50 chars
|
|
302
|
+
*/
|
|
106
303
|
user;
|
|
107
304
|
}
|
|
108
305
|
exports.SocialLoginResponseDTO = SocialLoginResponseDTO;
|
|
@@ -124,7 +321,29 @@ __decorate([
|
|
|
124
321
|
(0, class_validator_1.IsNumber)({}, { message: 'Refresh token expiration must be a number' }),
|
|
125
322
|
__metadata("design:type", Number)
|
|
126
323
|
], SocialLoginResponseDTO.prototype, "refreshTokenExpiresAt", void 0);
|
|
324
|
+
/**
|
|
325
|
+
* Response DTO for social account information
|
|
326
|
+
* Contains details about linked social accounts
|
|
327
|
+
*
|
|
328
|
+
* @example
|
|
329
|
+
* ```typescript
|
|
330
|
+
* // Response for user's linked social accounts
|
|
331
|
+
* {
|
|
332
|
+
* "accounts": [
|
|
333
|
+
* {
|
|
334
|
+
* "provider": "google",
|
|
335
|
+
* "providerEmail": "user@gmail.com",
|
|
336
|
+
* "linkedAt": "2023-01-01T00:00:00Z",
|
|
337
|
+
* "lastUsedAt": "2023-01-15T12:00:00Z"
|
|
338
|
+
* }
|
|
339
|
+
* ]
|
|
340
|
+
* }
|
|
341
|
+
* ```
|
|
342
|
+
*/
|
|
127
343
|
class SocialAccountsResponseDTO {
|
|
344
|
+
/**
|
|
345
|
+
* Array of linked social accounts
|
|
346
|
+
*/
|
|
128
347
|
accounts;
|
|
129
348
|
}
|
|
130
349
|
exports.SocialAccountsResponseDTO = SocialAccountsResponseDTO;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-login.dto.js","sourceRoot":"","sources":["../../../src/dto/social-login.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAgG;
|
|
1
|
+
{"version":3,"file":"social-login.dto.js","sourceRoot":"","sources":["../../../src/dto/social-login.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAgG;AAEhG;;GAEG;AACH,IAAY,cAIX;AAJD,WAAY,cAAc;IACx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;CAC3B;AAVD,wDAUC;AADC;IADC,IAAA,wBAAM,EAAC,cAAc,EAAE,EAAE,OAAO,EAAE,kDAAkD,EAAE,CAAC;;wDAC9D;AAG5B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,sBAAsB;IACjC;;;;;;OAMG;IAGH,WAAW,CAAU;IAErB;;;;;;OAMG;IAGH,YAAY,CAAU;IAEtB;;;;;OAKG;IAEH,oBAAoB,CAAU;IAE9B;;;;;OAKG;IAEH,qBAAqB,CAAU;IAE/B;;;;;;;;;;;OAWG;IACH,IAAI,CAOF;CACH;AA7DD,wDA6DC;AAnDC;IAFC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC;IACtD,IAAA,2BAAS,EAAC,IAAI,EAAE,EAAE,OAAO,EAAE,8CAA8C,EAAE,CAAC;;2DACxD;AAWrB;IAFC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,gCAAgC,EAAE,CAAC;IACvD,IAAA,2BAAS,EAAC,IAAI,EAAE,EAAE,OAAO,EAAE,+CAA+C,EAAE,CAAC;;4DACxD;AAStB;IADC,IAAA,0BAAQ,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE,CAAC;;oEACxC;AAS9B;IADC,IAAA,0BAAQ,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,2CAA2C,EAAE,CAAC;;qEACxC;AAwBjC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,yBAAyB;IACpC;;OAEG;IACH,QAAQ,CAKL;CACJ;AAVD,8DAUC"}
|
|
@@ -1,15 +1,74 @@
|
|
|
1
1
|
import { OAuthClient, OAuthConfig, OAuthUserProfile } from '@nauth-toolkit/core';
|
|
2
|
+
/**
|
|
3
|
+
* Facebook OAuth Client Implementation (Platform-Agnostic)
|
|
4
|
+
*
|
|
5
|
+
* Handles OAuth flow with Facebook's Graph API
|
|
6
|
+
* Uses Facebook's Graph API for profile data
|
|
7
|
+
*
|
|
8
|
+
* This is a plain TypeScript class with no framework dependencies.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const client = new FacebookOAuthClient({
|
|
13
|
+
* clientId: 'facebook_client_id',
|
|
14
|
+
* clientSecret: 'facebook_client_secret',
|
|
15
|
+
* redirectUri: 'https://myapp.com/auth/facebook/callback'
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* const profile = await client.getUserProfile(accessToken);
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
2
21
|
export declare class FacebookOAuthClient implements OAuthClient {
|
|
3
22
|
private readonly config;
|
|
4
23
|
private readonly tokenEndpoint;
|
|
5
24
|
private readonly userInfoEndpoint;
|
|
6
25
|
constructor(config: OAuthConfig);
|
|
26
|
+
/**
|
|
27
|
+
* Exchange authorization code for access token
|
|
28
|
+
*
|
|
29
|
+
* @param code - Authorization code from Facebook OAuth callback
|
|
30
|
+
* @param redirectUri - Redirect URI used in OAuth flow
|
|
31
|
+
* @returns Access token and optional refresh token
|
|
32
|
+
* @throws {Error} When token exchange fails
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const tokens = await client.exchangeCodeForToken(code, redirectUri);
|
|
37
|
+
* console.log(tokens.accessToken); // access_token_here
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
7
40
|
exchangeCodeForToken(code: string, redirectUri: string): Promise<{
|
|
8
41
|
accessToken: string;
|
|
9
42
|
refreshToken?: string;
|
|
10
43
|
expiresIn?: number;
|
|
11
44
|
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Get user profile from Facebook using access token
|
|
47
|
+
*
|
|
48
|
+
* @param accessToken - OAuth access token
|
|
49
|
+
* @returns User profile data
|
|
50
|
+
* @throws {Error} When API call fails or token is invalid
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const profile = await client.getUserProfile(accessToken);
|
|
55
|
+
* console.log(profile.email); // user@facebook.com
|
|
56
|
+
* console.log(profile.firstName); // John
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
12
59
|
getUserProfile(accessToken: string): Promise<OAuthUserProfile>;
|
|
60
|
+
/**
|
|
61
|
+
* Generate Facebook OAuth authorization URL
|
|
62
|
+
*
|
|
63
|
+
* @param state - Optional state parameter for CSRF protection
|
|
64
|
+
* @returns Authorization URL for redirecting user to Facebook
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const authUrl = client.getAuthorizationUrl('random-state');
|
|
69
|
+
* // Redirect user to authUrl
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
13
72
|
getAuthorizationUrl(state?: string): string;
|
|
14
73
|
}
|
|
15
74
|
//# sourceMappingURL=facebook-oauth.client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facebook-oauth.client.d.ts","sourceRoot":"","sources":["../../src/facebook-oauth.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAiC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"facebook-oauth.client.d.ts","sourceRoot":"","sources":["../../src/facebook-oauth.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAiC,MAAM,qBAAqB,CAAC;AAEhH;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,mBAAoB,YAAW,WAAW;IACrD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAyD;IACvF,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAyC;gBAE9D,MAAM,EAAE,WAAW;IAO/B;;;;;;;;;;;;;OAaG;IACG,oBAAoB,CACxB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;QACT,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAuCF;;;;;;;;;;;;;OAaG;IACG,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAqDpE;;;;;;;;;;;OAWG;IACH,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM;CAc5C"}
|
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FacebookOAuthClient = void 0;
|
|
4
4
|
const core_1 = require("@nauth-toolkit/core");
|
|
5
|
+
/**
|
|
6
|
+
* Facebook OAuth Client Implementation (Platform-Agnostic)
|
|
7
|
+
*
|
|
8
|
+
* Handles OAuth flow with Facebook's Graph API
|
|
9
|
+
* Uses Facebook's Graph API for profile data
|
|
10
|
+
*
|
|
11
|
+
* This is a plain TypeScript class with no framework dependencies.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const client = new FacebookOAuthClient({
|
|
16
|
+
* clientId: 'facebook_client_id',
|
|
17
|
+
* clientSecret: 'facebook_client_secret',
|
|
18
|
+
* redirectUri: 'https://myapp.com/auth/facebook/callback'
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* const profile = await client.getUserProfile(accessToken);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
5
24
|
class FacebookOAuthClient {
|
|
6
25
|
config;
|
|
7
26
|
tokenEndpoint = 'https://graph.facebook.com/v24.0/oauth/access_token';
|
|
@@ -12,6 +31,20 @@ class FacebookOAuthClient {
|
|
|
12
31
|
...config,
|
|
13
32
|
};
|
|
14
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Exchange authorization code for access token
|
|
36
|
+
*
|
|
37
|
+
* @param code - Authorization code from Facebook OAuth callback
|
|
38
|
+
* @param redirectUri - Redirect URI used in OAuth flow
|
|
39
|
+
* @returns Access token and optional refresh token
|
|
40
|
+
* @throws {Error} When token exchange fails
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const tokens = await client.exchangeCodeForToken(code, redirectUri);
|
|
45
|
+
* console.log(tokens.accessToken); // access_token_here
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
15
48
|
async exchangeCodeForToken(code, redirectUri) {
|
|
16
49
|
const params = new URLSearchParams({
|
|
17
50
|
client_id: this.config.clientId,
|
|
@@ -20,6 +53,7 @@ class FacebookOAuthClient {
|
|
|
20
53
|
redirect_uri: redirectUri,
|
|
21
54
|
});
|
|
22
55
|
try {
|
|
56
|
+
// Facebook returns the token in the URL, so we need to construct the URL
|
|
23
57
|
const url = `${this.tokenEndpoint}?${params.toString()}`;
|
|
24
58
|
const tokenResponse = await fetch(url);
|
|
25
59
|
if (!tokenResponse.ok) {
|
|
@@ -29,7 +63,7 @@ class FacebookOAuthClient {
|
|
|
29
63
|
const data = (await tokenResponse.json());
|
|
30
64
|
return {
|
|
31
65
|
accessToken: data.access_token,
|
|
32
|
-
refreshToken: undefined,
|
|
66
|
+
refreshToken: undefined, // Facebook doesn't provide refresh tokens in this flow
|
|
33
67
|
expiresIn: data.expires_in,
|
|
34
68
|
};
|
|
35
69
|
}
|
|
@@ -40,8 +74,23 @@ class FacebookOAuthClient {
|
|
|
40
74
|
throw new core_1.NAuthException(core_1.AuthErrorCode.SOCIAL_TOKEN_INVALID, 'Facebook token exchange failed: Unknown error');
|
|
41
75
|
}
|
|
42
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Get user profile from Facebook using access token
|
|
79
|
+
*
|
|
80
|
+
* @param accessToken - OAuth access token
|
|
81
|
+
* @returns User profile data
|
|
82
|
+
* @throws {Error} When API call fails or token is invalid
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const profile = await client.getUserProfile(accessToken);
|
|
87
|
+
* console.log(profile.email); // user@facebook.com
|
|
88
|
+
* console.log(profile.firstName); // John
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
43
91
|
async getUserProfile(accessToken) {
|
|
44
92
|
try {
|
|
93
|
+
// Facebook Graph API requires specific fields to be requested
|
|
45
94
|
const fields = 'id,email,first_name,last_name,picture';
|
|
46
95
|
const url = `${this.userInfoEndpoint}?fields=${fields}&access_token=${accessToken}`;
|
|
47
96
|
const response = await fetch(url, {
|
|
@@ -58,16 +107,19 @@ class FacebookOAuthClient {
|
|
|
58
107
|
throw new core_1.NAuthException(core_1.AuthErrorCode.INTERNAL_ERROR, `Facebook API call failed: ${errorData.error?.message || response.statusText}`);
|
|
59
108
|
}
|
|
60
109
|
const data = (await response.json());
|
|
110
|
+
// CRITICAL: Require email from Facebook for signup
|
|
61
111
|
if (!data.email) {
|
|
62
112
|
throw new core_1.NAuthException(core_1.AuthErrorCode.SOCIAL_EMAIL_REQUIRED, 'Email is required from Facebook. Please grant email permissions.');
|
|
63
113
|
}
|
|
114
|
+
// Map Facebook's response to our standardized format
|
|
115
|
+
// Email is always verified if Facebook returns it (same as Google/Apple)
|
|
64
116
|
return {
|
|
65
117
|
id: data.id,
|
|
66
118
|
email: data.email,
|
|
67
119
|
firstName: data.first_name || null,
|
|
68
120
|
lastName: data.last_name || null,
|
|
69
121
|
picture: data.picture?.data?.url || null,
|
|
70
|
-
verified: true,
|
|
122
|
+
verified: true, // Email is verified if provided by Facebook
|
|
71
123
|
raw: data,
|
|
72
124
|
};
|
|
73
125
|
}
|
|
@@ -78,6 +130,18 @@ class FacebookOAuthClient {
|
|
|
78
130
|
throw new core_1.NAuthException(core_1.AuthErrorCode.INTERNAL_ERROR, 'Facebook profile fetch failed: Unknown error');
|
|
79
131
|
}
|
|
80
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Generate Facebook OAuth authorization URL
|
|
135
|
+
*
|
|
136
|
+
* @param state - Optional state parameter for CSRF protection
|
|
137
|
+
* @returns Authorization URL for redirecting user to Facebook
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* const authUrl = client.getAuthorizationUrl('random-state');
|
|
142
|
+
* // Redirect user to authUrl
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
81
145
|
getAuthorizationUrl(state) {
|
|
82
146
|
const params = new URLSearchParams({
|
|
83
147
|
client_id: this.config.clientId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facebook-oauth.client.js","sourceRoot":"","sources":["../../src/facebook-oauth.client.ts"],"names":[],"mappings":";;;AAAA,8CAAgH;
|
|
1
|
+
{"version":3,"file":"facebook-oauth.client.js","sourceRoot":"","sources":["../../src/facebook-oauth.client.ts"],"names":[],"mappings":";;;AAAA,8CAAgH;AAEhH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,mBAAmB;IACb,MAAM,CAAc;IACpB,aAAa,GAAG,qDAAqD,CAAC;IACtE,gBAAgB,GAAG,qCAAqC,CAAC;IAE1E,YAAY,MAAmB;QAC7B,IAAI,CAAC,MAAM,GAAG;YACZ,MAAM,EAAE,CAAC,OAAO,EAAE,gBAAgB,CAAC;YACnC,GAAG,MAAM;SACV,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,oBAAoB,CACxB,IAAY,EACZ,WAAmB;QAMnB,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;YACjC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;YAC/B,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY;YACvC,IAAI;YACJ,YAAY,EAAE,WAAW;SAC1B,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,yEAAyE;YACzE,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;YACzD,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,GAAG,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zG,CAAC;IACH,CAAC;IAED;;;;;;;;;;;OAWG;IACH,mBAAmB,CAAC,KAAc;QAChC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;YACjC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;YAC/B,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW;YACrC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,sBAAsB;YAC9D,aAAa,EAAE,MAAM;SACtB,CAAC,CAAC;QAEH,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC;QAED,OAAO,+CAA+C,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC5E,CAAC;CACF;AArKD,kDAqKC"}
|
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
import { AuthService, SocialAuthService, ClientInfoService, NAuthConfig, NAuthLogger, OAuthUserProfile, PhoneVerificationService, ISocialAuthProviderService, ITokenVerifierService, BaseUser } from '@nauth-toolkit/core';
|
|
2
|
-
import { BaseSocialAuthProviderService, JwtService, SessionService, AuthChallengeHelperService, AuthAuditService,
|
|
2
|
+
import { BaseSocialAuthProviderService, JwtService, SessionService, AuthChallengeHelperService, AuthAuditService, // Internal version with recordEvent()
|
|
3
|
+
TrustedDeviceService } from '@nauth-toolkit/core/internal';
|
|
3
4
|
import { Repository } from 'typeorm';
|
|
5
|
+
/**
|
|
6
|
+
* Facebook Social Authentication Service (Platform-Agnostic)
|
|
7
|
+
*
|
|
8
|
+
* Handles Facebook OAuth flow including:
|
|
9
|
+
* - OAuth web flow (redirect-based)
|
|
10
|
+
* - Native mobile token verification
|
|
11
|
+
* - Account linking
|
|
12
|
+
*
|
|
13
|
+
* This is a plain TypeScript class with no framework dependencies.
|
|
14
|
+
* Use `@nauth-toolkit/social-facebook/nestjs` for NestJS integration.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // Direct instantiation (platform-agnostic)
|
|
19
|
+
* const facebookAuth = new FacebookSocialAuthService(
|
|
20
|
+
* config,
|
|
21
|
+
* logger,
|
|
22
|
+
* authService,
|
|
23
|
+
* socialAuthService,
|
|
24
|
+
* jwtService,
|
|
25
|
+
* sessionService,
|
|
26
|
+
* challengeHelper,
|
|
27
|
+
* clientInfoService,
|
|
28
|
+
* auditService,
|
|
29
|
+
* stateStore,
|
|
30
|
+
* phoneVerificationService,
|
|
31
|
+
* tokenVerifier
|
|
32
|
+
* );
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
4
35
|
export declare class FacebookSocialAuthService extends BaseSocialAuthProviderService implements ISocialAuthProviderService {
|
|
5
36
|
readonly providerName = "facebook";
|
|
6
37
|
private readonly oauthClient;
|
|
@@ -9,8 +40,35 @@ export declare class FacebookSocialAuthService extends BaseSocialAuthProviderSer
|
|
|
9
40
|
timestamp: number;
|
|
10
41
|
provider: string;
|
|
11
42
|
}>, userRepository: Repository<BaseUser>, phoneVerificationService?: PhoneVerificationService, auditService?: AuthAuditService, trustedDeviceService?: TrustedDeviceService, tokenVerifier?: ITokenVerifierService);
|
|
43
|
+
/**
|
|
44
|
+
* Generate OAuth authorization URL for Facebook
|
|
45
|
+
*
|
|
46
|
+
* @param state - Optional state parameter for CSRF protection
|
|
47
|
+
* @returns Authorization URL for redirecting user to Facebook
|
|
48
|
+
*/
|
|
12
49
|
getAuthUrl(state?: string): Promise<string>;
|
|
50
|
+
/**
|
|
51
|
+
* Get OAuth user profile from callback
|
|
52
|
+
*
|
|
53
|
+
* Exchanges authorization code for access token and fetches user profile.
|
|
54
|
+
*
|
|
55
|
+
* @param code - Authorization code from Facebook OAuth callback
|
|
56
|
+
* @param _state - State parameter (validated by base class)
|
|
57
|
+
* @returns User profile from Facebook
|
|
58
|
+
* @protected
|
|
59
|
+
*/
|
|
13
60
|
protected getOAuthProfile(code: string, _state: string): Promise<OAuthUserProfile>;
|
|
61
|
+
/**
|
|
62
|
+
* Verify Facebook access token from native mobile apps
|
|
63
|
+
*
|
|
64
|
+
* Facebook uses access tokens (not ID tokens) from native SDKs
|
|
65
|
+
*
|
|
66
|
+
* @param accessToken - Facebook access token from native SDK (passed as idToken parameter)
|
|
67
|
+
* @param _idToken - Not used for Facebook (Facebook uses access tokens)
|
|
68
|
+
* @param profileData - Optional profile data from native SDK
|
|
69
|
+
* @returns User profile from verified token
|
|
70
|
+
* @protected
|
|
71
|
+
*/
|
|
14
72
|
protected verifyNativeToken(idToken: string, _accessToken?: string, profileData?: unknown): Promise<OAuthUserProfile>;
|
|
15
73
|
}
|
|
16
74
|
//# sourceMappingURL=facebook-social-auth.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facebook-social-auth.service.d.ts","sourceRoot":"","sources":["../../src/facebook-social-auth.service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,gBAAgB,EAGhB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,QAAQ,EACT,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,6BAA6B,EAC7B,UAAU,EACV,cAAc,EACd,0BAA0B,EAC1B,gBAAgB,
|
|
1
|
+
{"version":3,"file":"facebook-social-auth.service.d.ts","sourceRoot":"","sources":["../../src/facebook-social-auth.service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,gBAAgB,EAGhB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,QAAQ,EACT,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,6BAA6B,EAC7B,UAAU,EACV,cAAc,EACd,0BAA0B,EAC1B,gBAAgB,EAAE,sCAAsC;AACxD,oBAAoB,EACrB,MAAM,8BAA8B,CAAC;A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