@oxyhq/services 5.20.3 → 5.21.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/lib/commonjs/core/mixins/OxyServices.fedcm.js +158 -19
- package/lib/commonjs/core/mixins/OxyServices.fedcm.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +16 -20
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAuth.js +3 -4
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useWebSSO.js +60 -0
- package/lib/commonjs/ui/hooks/useWebSSO.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.fedcm.js +158 -19
- package/lib/module/core/mixins/OxyServices.fedcm.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +16 -20
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/useAuth.js +3 -4
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useWebSSO.js +60 -0
- package/lib/module/ui/hooks/useWebSSO.js.map +1 -1
- package/lib/typescript/commonjs/core/mixins/OxyServices.fedcm.d.ts +1 -0
- package/lib/typescript/commonjs/core/mixins/OxyServices.fedcm.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useWebSSO.d.ts +2 -0
- package/lib/typescript/commonjs/ui/hooks/useWebSSO.d.ts.map +1 -1
- package/lib/typescript/module/core/mixins/OxyServices.fedcm.d.ts +1 -0
- package/lib/typescript/module/core/mixins/OxyServices.fedcm.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useWebSSO.d.ts +2 -0
- package/lib/typescript/module/ui/hooks/useWebSSO.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/mixins/OxyServices.fedcm.ts +160 -20
- package/src/ui/context/OxyContext.tsx +18 -9
- package/src/ui/hooks/useAuth.ts +3 -4
- package/src/ui/hooks/useWebSSO.ts +71 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OxyServices.fedcm.d.ts","sourceRoot":"","sources":["../../../../../src/core/mixins/OxyServices.fedcm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,KAAK,CAAC;CACpD;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAQD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,OAAO,eAAe,EAAE,IAAI,EAAE,CAAC;kBAEtD,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"OxyServices.fedcm.d.ts","sourceRoot":"","sources":["../../../../../src/core/mixins/OxyServices.fedcm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,KAAK,CAAC;CACpD;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,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,aAAa,CAAC,CAAC;CACvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,IAAI,aAAa,CA+GvC;AAGD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -26,6 +26,8 @@ interface UseWebSSOOptions {
|
|
|
26
26
|
interface UseWebSSOResult {
|
|
27
27
|
/** Manually trigger SSO check */
|
|
28
28
|
checkSSO: () => Promise<SessionLoginResponse | null>;
|
|
29
|
+
/** Trigger interactive FedCM sign-in (shows browser UI) */
|
|
30
|
+
signInWithFedCM: () => Promise<SessionLoginResponse | null>;
|
|
29
31
|
/** Whether SSO check is in progress */
|
|
30
32
|
isChecking: boolean;
|
|
31
33
|
/** Whether FedCM is supported in this browser */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWebSSO.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useWebSSO.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,UAAU,gBAAgB;IACxB,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,eAAe;IACvB,iCAAiC;IACjC,QAAQ,EAAE,MAAM,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IACrD,uCAAuC;IACvC,UAAU,EAAE,OAAO,CAAC;IACpB,iDAAiD;IACjD,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,iBAA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@@ -190,6 +190,7 @@ export declare function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(
|
|
|
190
190
|
};
|
|
191
191
|
readonly DEFAULT_CONFIG_URL: "https://auth.oxy.so/fedcm.json";
|
|
192
192
|
readonly FEDCM_TIMEOUT: 60000;
|
|
193
|
+
readonly FEDCM_SILENT_TIMEOUT: 10000;
|
|
193
194
|
/**
|
|
194
195
|
* Check if FedCM is supported in the current browser
|
|
195
196
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OxyServices.fedcm.d.ts","sourceRoot":"","sources":["../../../../../src/core/mixins/OxyServices.fedcm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,KAAK,CAAC;CACpD;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAQD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,OAAO,eAAe,EAAE,IAAI,EAAE,CAAC;kBAEtD,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"OxyServices.fedcm.d.ts","sourceRoot":"","sources":["../../../../../src/core/mixins/OxyServices.fedcm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,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AW,aAAc,SAAQ,SAAS,EAAE,WAAW;IAC3D,6DAA6D;IAC7D,WAAW,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC;CACvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,IAAI,aAAa,CA+GvC;AAGD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -26,6 +26,8 @@ interface UseWebSSOOptions {
|
|
|
26
26
|
interface UseWebSSOResult {
|
|
27
27
|
/** Manually trigger SSO check */
|
|
28
28
|
checkSSO: () => Promise<SessionLoginResponse | null>;
|
|
29
|
+
/** Trigger interactive FedCM sign-in (shows browser UI) */
|
|
30
|
+
signInWithFedCM: () => Promise<SessionLoginResponse | null>;
|
|
29
31
|
/** Whether SSO check is in progress */
|
|
30
32
|
isChecking: boolean;
|
|
31
33
|
/** Whether FedCM is supported in this browser */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWebSSO.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useWebSSO.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,UAAU,gBAAgB;IACxB,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,eAAe;IACvB,iCAAiC;IACjC,QAAQ,EAAE,MAAM,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IACrD,uCAAuC;I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EAChB,OAAO,EACP,OAAc,GACf,EAAE,gBAAgB,GAAG,eAAe,CA+IpC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/services",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.21.0",
|
|
4
4
|
"description": "Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -46,7 +46,8 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
46
46
|
super(...(args as [any]));
|
|
47
47
|
}
|
|
48
48
|
public static readonly DEFAULT_CONFIG_URL = 'https://auth.oxy.so/fedcm.json';
|
|
49
|
-
public static readonly FEDCM_TIMEOUT = 60000; // 1 minute
|
|
49
|
+
public static readonly FEDCM_TIMEOUT = 60000; // 1 minute for interactive
|
|
50
|
+
public static readonly FEDCM_SILENT_TIMEOUT = 10000; // 10 seconds for silent mediation
|
|
50
51
|
|
|
51
52
|
/**
|
|
52
53
|
* Check if FedCM is supported in the current browser
|
|
@@ -98,6 +99,10 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
98
99
|
const nonce = options.nonce || this.generateNonce();
|
|
99
100
|
const clientId = this.getClientId();
|
|
100
101
|
|
|
102
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
103
|
+
console.log('[FedCM] Interactive sign-in: Requesting credential for', clientId);
|
|
104
|
+
}
|
|
105
|
+
|
|
101
106
|
// Request credential from browser's native identity flow
|
|
102
107
|
const credential = await this.requestIdentityCredential({
|
|
103
108
|
configURL: (this.constructor as any).DEFAULT_CONFIG_URL,
|
|
@@ -110,6 +115,10 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
110
115
|
throw new OxyAuthenticationError('No credential received from browser');
|
|
111
116
|
}
|
|
112
117
|
|
|
118
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
119
|
+
console.log('[FedCM] Interactive sign-in: Got credential, exchanging for session');
|
|
120
|
+
}
|
|
121
|
+
|
|
113
122
|
// Exchange FedCM ID token for Oxy session
|
|
114
123
|
const session = await this.exchangeIdTokenForSession(credential.token);
|
|
115
124
|
|
|
@@ -118,8 +127,15 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
118
127
|
this.httpService.setTokens((session as any).accessToken);
|
|
119
128
|
}
|
|
120
129
|
|
|
130
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
131
|
+
console.log('[FedCM] Interactive sign-in: Success!', { userId: (session as any)?.user?.id });
|
|
132
|
+
}
|
|
133
|
+
|
|
121
134
|
return session;
|
|
122
135
|
} catch (error) {
|
|
136
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
137
|
+
console.log('[FedCM] Interactive sign-in failed:', error);
|
|
138
|
+
}
|
|
123
139
|
if ((error as any).name === 'AbortError') {
|
|
124
140
|
throw new OxyAuthenticationError('Sign-in was cancelled by user');
|
|
125
141
|
}
|
|
@@ -162,35 +178,102 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
162
178
|
*/
|
|
163
179
|
async silentSignInWithFedCM(): Promise<SessionLoginResponse | null> {
|
|
164
180
|
if (!this.isFedCMSupported()) {
|
|
181
|
+
console.log('[FedCM] Silent SSO: FedCM not supported in this browser');
|
|
165
182
|
return null;
|
|
166
183
|
}
|
|
167
184
|
|
|
185
|
+
const clientId = this.getClientId();
|
|
186
|
+
console.log('[FedCM] Silent SSO: Starting for', clientId);
|
|
187
|
+
|
|
188
|
+
// First try silent mediation (no UI) - works if user previously consented
|
|
189
|
+
let credential: { token: string } | null = null;
|
|
190
|
+
|
|
168
191
|
try {
|
|
169
192
|
const nonce = this.generateNonce();
|
|
170
|
-
|
|
193
|
+
console.log('[FedCM] Silent SSO: Attempting silent mediation...');
|
|
171
194
|
|
|
172
|
-
|
|
173
|
-
const credential = await this.requestIdentityCredential({
|
|
195
|
+
credential = await this.requestIdentityCredential({
|
|
174
196
|
configURL: (this.constructor as any).DEFAULT_CONFIG_URL,
|
|
175
197
|
clientId,
|
|
176
198
|
nonce,
|
|
177
199
|
mediation: 'silent',
|
|
178
200
|
});
|
|
179
201
|
|
|
180
|
-
|
|
202
|
+
console.log('[FedCM] Silent SSO: Silent mediation result:', { hasCredential: !!credential, hasToken: !!credential?.token });
|
|
203
|
+
} catch (silentError) {
|
|
204
|
+
// Silent mediation failed - this is expected if user hasn't consented before or is in quiet period
|
|
205
|
+
const errorName = silentError instanceof Error ? silentError.name : 'Unknown';
|
|
206
|
+
const errorMessage = silentError instanceof Error ? silentError.message : String(silentError);
|
|
207
|
+
console.log('[FedCM] Silent SSO: Silent mediation error (will try optional):', { name: errorName, message: errorMessage });
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// If silent failed, try optional mediation which shows browser UI if needed
|
|
211
|
+
if (!credential || !credential.token) {
|
|
212
|
+
try {
|
|
213
|
+
const nonce = this.generateNonce();
|
|
214
|
+
console.log('[FedCM] Silent SSO: Trying optional mediation (may show browser UI)...');
|
|
215
|
+
|
|
216
|
+
credential = await this.requestIdentityCredential({
|
|
217
|
+
configURL: (this.constructor as any).DEFAULT_CONFIG_URL,
|
|
218
|
+
clientId,
|
|
219
|
+
nonce,
|
|
220
|
+
mediation: 'optional',
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
console.log('[FedCM] Silent SSO: Optional mediation result:', { hasCredential: !!credential, hasToken: !!credential?.token });
|
|
224
|
+
} catch (optionalError) {
|
|
225
|
+
const errorName = optionalError instanceof Error ? optionalError.name : 'Unknown';
|
|
226
|
+
const errorMessage = optionalError instanceof Error ? optionalError.message : String(optionalError);
|
|
227
|
+
console.log('[FedCM] Silent SSO: Optional mediation also failed:', { name: errorName, message: errorMessage });
|
|
181
228
|
return null;
|
|
182
229
|
}
|
|
230
|
+
}
|
|
183
231
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
232
|
+
if (!credential || !credential.token) {
|
|
233
|
+
console.log('[FedCM] Silent SSO: No credential returned (user may have dismissed prompt or is not logged in at IdP)');
|
|
234
|
+
return null;
|
|
235
|
+
}
|
|
188
236
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
237
|
+
console.log('[FedCM] Silent SSO: Got credential, exchanging for session...');
|
|
238
|
+
|
|
239
|
+
let session: SessionLoginResponse;
|
|
240
|
+
try {
|
|
241
|
+
session = await this.exchangeIdTokenForSession(credential.token);
|
|
242
|
+
} catch (exchangeError) {
|
|
243
|
+
console.error('[FedCM] Silent SSO: Token exchange failed:', exchangeError);
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Validate session response has required fields
|
|
248
|
+
if (!session) {
|
|
249
|
+
console.error('[FedCM] Silent SSO: Exchange returned null session');
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (!session.sessionId) {
|
|
254
|
+
console.error('[FedCM] Silent SSO: Exchange returned session without sessionId:', session);
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (!session.user) {
|
|
259
|
+
console.error('[FedCM] Silent SSO: Exchange returned session without user:', session);
|
|
192
260
|
return null;
|
|
193
261
|
}
|
|
262
|
+
|
|
263
|
+
// Set the access token
|
|
264
|
+
if ((session as any).accessToken) {
|
|
265
|
+
this.httpService.setTokens((session as any).accessToken);
|
|
266
|
+
console.log('[FedCM] Silent SSO: Access token set');
|
|
267
|
+
} else {
|
|
268
|
+
console.warn('[FedCM] Silent SSO: No accessToken in session response');
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
console.log('[FedCM] Silent SSO: Success!', {
|
|
272
|
+
sessionId: session.sessionId?.substring(0, 8) + '...',
|
|
273
|
+
userId: session.user?.id
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
return session;
|
|
194
277
|
}
|
|
195
278
|
|
|
196
279
|
/**
|
|
@@ -213,8 +296,15 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
213
296
|
const requestedMediation = options.mediation || 'optional';
|
|
214
297
|
const isInteractive = requestedMediation !== 'silent';
|
|
215
298
|
|
|
299
|
+
console.log('[FedCM] requestIdentityCredential called:', {
|
|
300
|
+
mediation: requestedMediation,
|
|
301
|
+
clientId: options.clientId,
|
|
302
|
+
inProgress: fedCMRequestInProgress,
|
|
303
|
+
});
|
|
304
|
+
|
|
216
305
|
// If a request is already in progress...
|
|
217
306
|
if (fedCMRequestInProgress && fedCMRequestPromise) {
|
|
307
|
+
console.log('[FedCM] Request already in progress, waiting...');
|
|
218
308
|
// If current request is silent and new request is interactive,
|
|
219
309
|
// wait for silent to finish, then make the interactive request
|
|
220
310
|
if (currentMediationMode === 'silent' && isInteractive) {
|
|
@@ -237,10 +327,18 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
237
327
|
fedCMRequestInProgress = true;
|
|
238
328
|
currentMediationMode = requestedMediation;
|
|
239
329
|
const controller = new AbortController();
|
|
240
|
-
|
|
330
|
+
// Use shorter timeout for silent mediation since it should be quick
|
|
331
|
+
const timeoutMs = requestedMediation === 'silent'
|
|
332
|
+
? (this.constructor as any).FEDCM_SILENT_TIMEOUT
|
|
333
|
+
: (this.constructor as any).FEDCM_TIMEOUT;
|
|
334
|
+
const timeout = setTimeout(() => {
|
|
335
|
+
console.log('[FedCM] Request timed out after', timeoutMs, 'ms (mediation:', requestedMediation + ')');
|
|
336
|
+
controller.abort();
|
|
337
|
+
}, timeoutMs);
|
|
241
338
|
|
|
242
339
|
fedCMRequestPromise = (async () => {
|
|
243
340
|
try {
|
|
341
|
+
console.log('[FedCM] Calling navigator.credentials.get with mediation:', requestedMediation);
|
|
244
342
|
// Type assertion needed as FedCM types may not be in all TypeScript versions
|
|
245
343
|
const credential = (await (navigator.credentials as any).get({
|
|
246
344
|
identity: {
|
|
@@ -248,7 +346,11 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
248
346
|
{
|
|
249
347
|
configURL: options.configURL,
|
|
250
348
|
clientId: options.clientId,
|
|
251
|
-
nonce
|
|
349
|
+
// Send nonce at both levels for backward compatibility
|
|
350
|
+
nonce: options.nonce, // For older browsers
|
|
351
|
+
params: {
|
|
352
|
+
nonce: options.nonce, // For Chrome 145+
|
|
353
|
+
},
|
|
252
354
|
...(options.context && { loginHint: options.context }),
|
|
253
355
|
},
|
|
254
356
|
],
|
|
@@ -257,11 +359,24 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
257
359
|
signal: controller.signal,
|
|
258
360
|
})) as any;
|
|
259
361
|
|
|
362
|
+
console.log('[FedCM] navigator.credentials.get returned:', {
|
|
363
|
+
hasCredential: !!credential,
|
|
364
|
+
type: credential?.type,
|
|
365
|
+
hasToken: !!credential?.token,
|
|
366
|
+
});
|
|
367
|
+
|
|
260
368
|
if (!credential || credential.type !== 'identity') {
|
|
369
|
+
console.log('[FedCM] No valid identity credential returned');
|
|
261
370
|
return null;
|
|
262
371
|
}
|
|
263
372
|
|
|
373
|
+
console.log('[FedCM] Got valid identity credential with token');
|
|
264
374
|
return { token: credential.token };
|
|
375
|
+
} catch (error) {
|
|
376
|
+
const errorName = error instanceof Error ? error.name : 'Unknown';
|
|
377
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
378
|
+
console.log('[FedCM] navigator.credentials.get error:', { name: errorName, message: errorMessage });
|
|
379
|
+
throw error;
|
|
265
380
|
} finally {
|
|
266
381
|
clearTimeout(timeout);
|
|
267
382
|
fedCMRequestInProgress = false;
|
|
@@ -282,12 +397,37 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
282
397
|
* @private
|
|
283
398
|
*/
|
|
284
399
|
public async exchangeIdTokenForSession(idToken: string): Promise<SessionLoginResponse> {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
400
|
+
console.log('[FedCM] exchangeIdTokenForSession: Starting exchange...');
|
|
401
|
+
console.log('[FedCM] exchangeIdTokenForSession: Token length:', idToken?.length);
|
|
402
|
+
console.log('[FedCM] exchangeIdTokenForSession: Token preview:', idToken?.substring(0, 50) + '...');
|
|
403
|
+
|
|
404
|
+
try {
|
|
405
|
+
const response = await this.makeRequest<SessionLoginResponse>(
|
|
406
|
+
'POST',
|
|
407
|
+
'/api/fedcm/exchange',
|
|
408
|
+
{ id_token: idToken },
|
|
409
|
+
{ cache: false }
|
|
410
|
+
);
|
|
411
|
+
|
|
412
|
+
console.log('[FedCM] exchangeIdTokenForSession: Response received:', {
|
|
413
|
+
hasResponse: !!response,
|
|
414
|
+
hasSessionId: !!(response as any)?.sessionId,
|
|
415
|
+
hasUser: !!(response as any)?.user,
|
|
416
|
+
hasAccessToken: !!(response as any)?.accessToken,
|
|
417
|
+
userId: (response as any)?.user?.id,
|
|
418
|
+
username: (response as any)?.user?.username,
|
|
419
|
+
responseKeys: response ? Object.keys(response) : [],
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
return response;
|
|
423
|
+
} catch (error) {
|
|
424
|
+
console.error('[FedCM] exchangeIdTokenForSession: Error:', {
|
|
425
|
+
name: error instanceof Error ? error.name : 'Unknown',
|
|
426
|
+
message: error instanceof Error ? error.message : String(error),
|
|
427
|
+
stack: error instanceof Error ? error.stack : undefined,
|
|
428
|
+
});
|
|
429
|
+
throw error;
|
|
430
|
+
}
|
|
291
431
|
}
|
|
292
432
|
|
|
293
433
|
/**
|
|
@@ -428,16 +428,20 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
428
428
|
// Web SSO: Automatically check for cross-domain session on web platforms
|
|
429
429
|
// Also used for popup auth - updates all state and persists session
|
|
430
430
|
const handleWebSSOSession = useCallback(async (session: any) => {
|
|
431
|
+
console.log('[OxyContext] handleWebSSOSession called:', {
|
|
432
|
+
hasSession: !!session,
|
|
433
|
+
hasUser: !!session?.user,
|
|
434
|
+
hasSessionId: !!session?.sessionId,
|
|
435
|
+
sessionIdPrefix: session?.sessionId?.substring(0, 8),
|
|
436
|
+
userId: session?.user?.id,
|
|
437
|
+
});
|
|
438
|
+
|
|
431
439
|
if (!session?.user || !session?.sessionId) {
|
|
432
|
-
|
|
433
|
-
loggerUtil.warn('handleWebSSOSession called with invalid session', { component: 'OxyContext' }, { session });
|
|
434
|
-
}
|
|
440
|
+
console.warn('[OxyContext] handleWebSSOSession: Invalid session - missing user or sessionId');
|
|
435
441
|
return;
|
|
436
442
|
}
|
|
437
443
|
|
|
438
|
-
|
|
439
|
-
loggerUtil.debug('handleWebSSOSession: Updating auth state', { component: 'OxyContext' }, { sessionId: session.sessionId, userId: session.user?.id });
|
|
440
|
-
}
|
|
444
|
+
console.log('[OxyContext] handleWebSSOSession: Processing valid session...');
|
|
441
445
|
|
|
442
446
|
// Update sessions state
|
|
443
447
|
const clientSession = {
|
|
@@ -463,10 +467,15 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
463
467
|
sessionIds.push(session.sessionId);
|
|
464
468
|
await storage.setItem(storageKeys.sessionIds, JSON.stringify(sessionIds));
|
|
465
469
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
470
|
+
console.log('[OxyContext] handleWebSSOSession: Session persisted to storage', {
|
|
471
|
+
sessionId: session.sessionId?.substring(0, 8),
|
|
472
|
+
totalSessions: sessionIds.length,
|
|
473
|
+
});
|
|
474
|
+
} else {
|
|
475
|
+
console.warn('[OxyContext] handleWebSSOSession: No storage available, session not persisted!');
|
|
469
476
|
}
|
|
477
|
+
|
|
478
|
+
console.log('[OxyContext] handleWebSSOSession: Complete! User should now be authenticated.');
|
|
470
479
|
}, [updateSessions, setActiveSessionId, loginSuccess, onAuthStateChange, storage, storageKeys]);
|
|
471
480
|
|
|
472
481
|
// Enable web SSO only after local storage check completes and no user found
|
package/src/ui/hooks/useAuth.ts
CHANGED
|
@@ -108,10 +108,9 @@ export function useAuth(): UseAuthReturn {
|
|
|
108
108
|
window.location.hostname === 'auth.oxy.so';
|
|
109
109
|
|
|
110
110
|
// Web (not on IdP): Use popup-based authentication
|
|
111
|
-
// We
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
// 3. Doing FedCM first loses the "user gesture" needed for popups
|
|
111
|
+
// We go straight to popup to preserve the "user gesture" (click event)
|
|
112
|
+
// FedCM silent SSO already runs on page load via useWebSSO
|
|
113
|
+
// If user is clicking "Sign In", they need interactive auth NOW
|
|
115
114
|
if (isWebBrowser() && !publicKey && !isIdentityProvider) {
|
|
116
115
|
try {
|
|
117
116
|
const popupSession = await (oxyServices as any).signInWithPopup?.();
|
|
@@ -30,6 +30,8 @@ interface UseWebSSOOptions {
|
|
|
30
30
|
interface UseWebSSOResult {
|
|
31
31
|
/** Manually trigger SSO check */
|
|
32
32
|
checkSSO: () => Promise<SessionLoginResponse | null>;
|
|
33
|
+
/** Trigger interactive FedCM sign-in (shows browser UI) */
|
|
34
|
+
signInWithFedCM: () => Promise<SessionLoginResponse | null>;
|
|
33
35
|
/** Whether SSO check is in progress */
|
|
34
36
|
isChecking: boolean;
|
|
35
37
|
/** Whether FedCM is supported in this browser */
|
|
@@ -85,12 +87,20 @@ export function useWebSSO({
|
|
|
85
87
|
const fedCMSupported = isWebBrowser() && (oxyServices as any).isFedCMSupported?.();
|
|
86
88
|
|
|
87
89
|
const checkSSO = useCallback(async (): Promise<SessionLoginResponse | null> => {
|
|
90
|
+
console.log('[useWebSSO] checkSSO called', {
|
|
91
|
+
isWebBrowser: isWebBrowser(),
|
|
92
|
+
isChecking: isCheckingRef.current,
|
|
93
|
+
isIdP: isIdentityProvider(),
|
|
94
|
+
fedCMSupported,
|
|
95
|
+
});
|
|
96
|
+
|
|
88
97
|
if (!isWebBrowser() || isCheckingRef.current) {
|
|
89
98
|
return null;
|
|
90
99
|
}
|
|
91
100
|
|
|
92
101
|
// Don't use FedCM on the auth domain itself - it would authenticate against itself
|
|
93
102
|
if (isIdentityProvider()) {
|
|
103
|
+
console.log('[useWebSSO] Skipping - on identity provider domain');
|
|
94
104
|
onSSOUnavailable?.();
|
|
95
105
|
return null;
|
|
96
106
|
}
|
|
@@ -98,27 +108,39 @@ export function useWebSSO({
|
|
|
98
108
|
// FedCM is the only reliable cross-domain SSO mechanism
|
|
99
109
|
// Third-party cookies are deprecated and unreliable
|
|
100
110
|
if (!fedCMSupported) {
|
|
111
|
+
console.log('[useWebSSO] Skipping - FedCM not supported');
|
|
101
112
|
onSSOUnavailable?.();
|
|
102
113
|
return null;
|
|
103
114
|
}
|
|
104
115
|
|
|
105
116
|
isCheckingRef.current = true;
|
|
117
|
+
console.log('[useWebSSO] Starting FedCM silent sign-in...');
|
|
106
118
|
|
|
107
119
|
try {
|
|
108
120
|
// Use FedCM for cross-domain SSO
|
|
109
121
|
// This works because browser treats IdP requests as first-party
|
|
110
122
|
const session = await (oxyServices as any).silentSignInWithFedCM?.();
|
|
111
123
|
|
|
124
|
+
console.log('[useWebSSO] FedCM result:', {
|
|
125
|
+
hasSession: !!session,
|
|
126
|
+
hasUser: !!session?.user,
|
|
127
|
+
hasSessionId: !!session?.sessionId,
|
|
128
|
+
});
|
|
129
|
+
|
|
112
130
|
if (session) {
|
|
131
|
+
console.log('[useWebSSO] Session found, calling onSessionFound...');
|
|
113
132
|
await onSessionFound(session);
|
|
133
|
+
console.log('[useWebSSO] onSessionFound completed');
|
|
114
134
|
return session;
|
|
115
135
|
}
|
|
116
136
|
|
|
117
137
|
// No session found - user needs to sign in
|
|
138
|
+
console.log('[useWebSSO] No session returned from FedCM');
|
|
118
139
|
onSSOUnavailable?.();
|
|
119
140
|
return null;
|
|
120
141
|
} catch (error) {
|
|
121
142
|
// FedCM failed - could be network error, user not signed in, etc.
|
|
143
|
+
console.error('[useWebSSO] FedCM error:', error);
|
|
122
144
|
onSSOUnavailable?.();
|
|
123
145
|
onError?.(error instanceof Error ? error : new Error(String(error)));
|
|
124
146
|
return null;
|
|
@@ -127,6 +149,54 @@ export function useWebSSO({
|
|
|
127
149
|
}
|
|
128
150
|
}, [oxyServices, onSessionFound, onSSOUnavailable, onError, fedCMSupported]);
|
|
129
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Trigger interactive FedCM sign-in
|
|
154
|
+
* This shows the browser's native "Sign in with Oxy" prompt.
|
|
155
|
+
* Use this when silent mediation fails (user hasn't previously consented).
|
|
156
|
+
*/
|
|
157
|
+
const signInWithFedCM = useCallback(async (): Promise<SessionLoginResponse | null> => {
|
|
158
|
+
console.log('[useWebSSO] signInWithFedCM called');
|
|
159
|
+
|
|
160
|
+
if (!isWebBrowser() || isCheckingRef.current) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (!fedCMSupported) {
|
|
165
|
+
console.log('[useWebSSO] FedCM not supported for interactive sign-in');
|
|
166
|
+
onError?.(new Error('FedCM is not supported in this browser'));
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
isCheckingRef.current = true;
|
|
171
|
+
console.log('[useWebSSO] Starting interactive FedCM sign-in...');
|
|
172
|
+
|
|
173
|
+
try {
|
|
174
|
+
// Use interactive sign-in (shows browser UI)
|
|
175
|
+
const session = await (oxyServices as any).signInWithFedCM?.();
|
|
176
|
+
|
|
177
|
+
console.log('[useWebSSO] Interactive FedCM result:', {
|
|
178
|
+
hasSession: !!session,
|
|
179
|
+
hasUser: !!session?.user,
|
|
180
|
+
hasSessionId: !!session?.sessionId,
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
if (session) {
|
|
184
|
+
console.log('[useWebSSO] Interactive session found, calling onSessionFound...');
|
|
185
|
+
await onSessionFound(session);
|
|
186
|
+
console.log('[useWebSSO] onSessionFound completed');
|
|
187
|
+
return session;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return null;
|
|
191
|
+
} catch (error) {
|
|
192
|
+
console.error('[useWebSSO] Interactive FedCM error:', error);
|
|
193
|
+
onError?.(error instanceof Error ? error : new Error(String(error)));
|
|
194
|
+
return null;
|
|
195
|
+
} finally {
|
|
196
|
+
isCheckingRef.current = false;
|
|
197
|
+
}
|
|
198
|
+
}, [oxyServices, onSessionFound, onError, fedCMSupported]);
|
|
199
|
+
|
|
130
200
|
// Auto-check SSO on mount (web only, FedCM only, not on auth domain)
|
|
131
201
|
useEffect(() => {
|
|
132
202
|
if (!enabled || !isWebBrowser() || hasCheckedRef.current || isIdentityProvider()) {
|
|
@@ -148,6 +218,7 @@ export function useWebSSO({
|
|
|
148
218
|
|
|
149
219
|
return {
|
|
150
220
|
checkSSO,
|
|
221
|
+
signInWithFedCM,
|
|
151
222
|
isChecking: isCheckingRef.current,
|
|
152
223
|
isFedCMSupported: fedCMSupported,
|
|
153
224
|
};
|