@microsoft/rayfin-auth-provider-fabric 1.32.0 → 1.33.0-beta.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/PostMessageAuthTransport.d.ts +7 -6
- package/dist/PostMessageAuthTransport.js +7 -6
- package/dist/brokerUrl.d.ts +3 -3
- package/dist/brokerUrl.js +7 -5
- package/dist/embeddedFabricLogin.d.ts +3 -3
- package/dist/embeddedFabricLogin.js +3 -3
- package/dist/ensureSignedInWithFabric.d.ts +3 -3
- package/dist/ensureSignedInWithFabric.js +3 -3
- package/dist/initEmbeddedAuth.d.ts +2 -2
- package/dist/initEmbeddedAuth.js +2 -2
- package/dist/initiateFabricLogin.d.ts +3 -3
- package/dist/initiateFabricLogin.js +3 -3
- package/package.json +4 -4
|
@@ -16,13 +16,14 @@ export interface PostMessageHandoffResult {
|
|
|
16
16
|
* Delegates the low-level postMessage send/receive/correlate to
|
|
17
17
|
* `sendBridgeRequest` from `@microsoft/fabric-embedded-host`.
|
|
18
18
|
*
|
|
19
|
-
* @param params
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
19
|
+
* @param params - Handoff request parameters:
|
|
20
|
+
* - `callbackUrl`: The callback origin where the SPA is hosted.
|
|
21
|
+
* - `codeChallenge`: PKCE S256 code challenge.
|
|
22
|
+
* - `codeChallengeMethod`: Always `"S256"`.
|
|
23
|
+
* - `state`: Opaque nonce for CSRF/correlation.
|
|
24
|
+
* - `timeoutMs`: Response timeout in milliseconds (default 30 000).
|
|
24
25
|
* @returns Promise resolving with the handoff code and state.
|
|
25
|
-
* @throws
|
|
26
|
+
* @throws `AuthError` - On timeout, error response, or missing parent.
|
|
26
27
|
*/
|
|
27
28
|
export declare function requestHandoff(params: {
|
|
28
29
|
callbackUrl: string;
|
|
@@ -9,13 +9,14 @@ import { AuthError } from '@microsoft/rayfin-lib';
|
|
|
9
9
|
* Delegates the low-level postMessage send/receive/correlate to
|
|
10
10
|
* `sendBridgeRequest` from `@microsoft/fabric-embedded-host`.
|
|
11
11
|
*
|
|
12
|
-
* @param params
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* @param params - Handoff request parameters:
|
|
13
|
+
* - `callbackUrl`: The callback origin where the SPA is hosted.
|
|
14
|
+
* - `codeChallenge`: PKCE S256 code challenge.
|
|
15
|
+
* - `codeChallengeMethod`: Always `"S256"`.
|
|
16
|
+
* - `state`: Opaque nonce for CSRF/correlation.
|
|
17
|
+
* - `timeoutMs`: Response timeout in milliseconds (default 30 000).
|
|
17
18
|
* @returns Promise resolving with the handoff code and state.
|
|
18
|
-
* @throws
|
|
19
|
+
* @throws `AuthError` - On timeout, error response, or missing parent.
|
|
19
20
|
*/
|
|
20
21
|
export function requestHandoff(params) {
|
|
21
22
|
const { callbackUrl, codeChallenge, codeChallengeMethod, state, timeoutMs } = params;
|
package/dist/brokerUrl.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ import type { FabricAuthOptions } from './types.js';
|
|
|
5
5
|
* Preserves any existing path and query parameters on `fabricPortalUrl`,
|
|
6
6
|
* appends the artifact deep-link path, and adds PKCE query parameters.
|
|
7
7
|
*
|
|
8
|
-
* @param options Auth options (workspace/project IDs, portal URL).
|
|
9
|
-
* @param codeChallenge PKCE S256 code challenge.
|
|
10
|
-
* @param state CSRF/correlation state nonce.
|
|
8
|
+
* @param options - Auth options (workspace/project IDs, portal URL).
|
|
9
|
+
* @param codeChallenge - PKCE S256 code challenge.
|
|
10
|
+
* @param state - CSRF/correlation state nonce.
|
|
11
11
|
* @returns Fully constructed broker URL.
|
|
12
12
|
*/
|
|
13
13
|
export declare function buildBrokerUrl(options: FabricAuthOptions, codeChallenge: string, state: string): string;
|
package/dist/brokerUrl.js
CHANGED
|
@@ -4,16 +4,18 @@
|
|
|
4
4
|
* Preserves any existing path and query parameters on `fabricPortalUrl`,
|
|
5
5
|
* appends the artifact deep-link path, and adds PKCE query parameters.
|
|
6
6
|
*
|
|
7
|
-
* @param options Auth options (workspace/project IDs, portal URL).
|
|
8
|
-
* @param codeChallenge PKCE S256 code challenge.
|
|
9
|
-
* @param state CSRF/correlation state nonce.
|
|
7
|
+
* @param options - Auth options (workspace/project IDs, portal URL).
|
|
8
|
+
* @param codeChallenge - PKCE S256 code challenge.
|
|
9
|
+
* @param state - CSRF/correlation state nonce.
|
|
10
10
|
* @returns Fully constructed broker URL.
|
|
11
11
|
*/
|
|
12
12
|
export function buildBrokerUrl(options, codeChallenge, state) {
|
|
13
13
|
const portalUrl = new URL(options.fabricPortalUrl);
|
|
14
|
-
// Append artifact deep-link path
|
|
14
|
+
// Append artifact deep-link path with /BrokeredAuth route segment.
|
|
15
|
+
// Query params are preserved for backward compatibility with older
|
|
16
|
+
// AppBackend versions that detect broker mode via parseBrokerParams.
|
|
15
17
|
const basePath = portalUrl.pathname.replace(/\/$/, '');
|
|
16
|
-
const artifactPath = `/groups/${encodeURIComponent(options.workspaceId)}/appbackends/${encodeURIComponent(options.projectId)}`;
|
|
18
|
+
const artifactPath = `/groups/${encodeURIComponent(options.workspaceId)}/appbackends/${encodeURIComponent(options.projectId)}/brokeredauth`;
|
|
17
19
|
portalUrl.pathname = `${basePath}${artifactPath}`;
|
|
18
20
|
// `returnOrigin` must be a bare origin (scheme + host + port) — used as
|
|
19
21
|
// the postMessage targetOrigin and the redirect target for legacy brokers.
|
|
@@ -15,9 +15,9 @@ import type { FabricAuthOptions } from './types.js';
|
|
|
15
15
|
*
|
|
16
16
|
* The session is stored in the iframe's own `localStorage`.
|
|
17
17
|
*
|
|
18
|
-
* @param auth Auth instance for token exchange and session management.
|
|
19
|
-
* @param options Fabric auth options (`returnOrigin` required).
|
|
20
|
-
* @throws
|
|
18
|
+
* @param auth - Auth instance for token exchange and session management.
|
|
19
|
+
* @param options - Fabric auth options (`returnOrigin` required).
|
|
20
|
+
* @throws `AuthError` - On missing options, transport failure, or token exchange error.
|
|
21
21
|
*/
|
|
22
22
|
export declare function embeddedFabricLogin(auth: Auth, options: FabricAuthOptions): Promise<void>;
|
|
23
23
|
//# sourceMappingURL=embeddedFabricLogin.d.ts.map
|
|
@@ -17,9 +17,9 @@ import { markEmbeddedHandoffCompleted } from './fabricAuthHelpers.js';
|
|
|
17
17
|
*
|
|
18
18
|
* The session is stored in the iframe's own `localStorage`.
|
|
19
19
|
*
|
|
20
|
-
* @param auth Auth instance for token exchange and session management.
|
|
21
|
-
* @param options Fabric auth options (`returnOrigin` required).
|
|
22
|
-
* @throws
|
|
20
|
+
* @param auth - Auth instance for token exchange and session management.
|
|
21
|
+
* @param options - Fabric auth options (`returnOrigin` required).
|
|
22
|
+
* @throws `AuthError` - On missing options, transport failure, or token exchange error.
|
|
23
23
|
*/
|
|
24
24
|
export async function embeddedFabricLogin(auth, options) {
|
|
25
25
|
if (!options.returnOrigin) {
|
|
@@ -25,10 +25,10 @@ import type { FabricAuthOptions } from './types.js';
|
|
|
25
25
|
* from inside a synchronous user-gesture handler (e.g., a button click).
|
|
26
26
|
* Steps 1–3 do not open windows and are safe to call on page load.
|
|
27
27
|
*
|
|
28
|
-
* @param auth The Auth instance.
|
|
29
|
-
* @param options Fabric authentication options (workspaceId, projectId, returnOrigin).
|
|
28
|
+
* @param auth - The Auth instance.
|
|
29
|
+
* @param options - Fabric authentication options (workspaceId, projectId, returnOrigin).
|
|
30
30
|
* @returns A promise that resolves with the authenticated session.
|
|
31
|
-
* @throws
|
|
31
|
+
* @throws `AuthError` - If all steps fail or the broker tab is blocked.
|
|
32
32
|
*/
|
|
33
33
|
export declare function ensureSignedInWithFabric(auth: Auth, options: FabricAuthOptions): Promise<OpaqueSession>;
|
|
34
34
|
//# sourceMappingURL=ensureSignedInWithFabric.d.ts.map
|
|
@@ -27,10 +27,10 @@ import { initiateFabricLogin } from './initiateFabricLogin.js';
|
|
|
27
27
|
* from inside a synchronous user-gesture handler (e.g., a button click).
|
|
28
28
|
* Steps 1–3 do not open windows and are safe to call on page load.
|
|
29
29
|
*
|
|
30
|
-
* @param auth The Auth instance.
|
|
31
|
-
* @param options Fabric authentication options (workspaceId, projectId, returnOrigin).
|
|
30
|
+
* @param auth - The Auth instance.
|
|
31
|
+
* @param options - Fabric authentication options (workspaceId, projectId, returnOrigin).
|
|
32
32
|
* @returns A promise that resolves with the authenticated session.
|
|
33
|
-
* @throws
|
|
33
|
+
* @throws `AuthError` - If all steps fail or the broker tab is blocked.
|
|
34
34
|
*/
|
|
35
35
|
export async function ensureSignedInWithFabric(auth, options) {
|
|
36
36
|
// Steps 1-2: existing session or refresh.
|
|
@@ -23,8 +23,8 @@ import type { FabricAuthOptions } from './types.js';
|
|
|
23
23
|
* {@link ensureSignedInWithFabric} from a user-gesture handler for the
|
|
24
24
|
* non-embedded case.
|
|
25
25
|
*
|
|
26
|
-
* @param auth
|
|
27
|
-
* @param options
|
|
26
|
+
* @param auth - The Auth instance.
|
|
27
|
+
* @param options - Fabric authentication options.
|
|
28
28
|
* @returns The authenticated session, or `null` if not in embedded mode.
|
|
29
29
|
*/
|
|
30
30
|
export declare function initEmbeddedAuth(auth: Auth, options: FabricAuthOptions): Promise<OpaqueSession | null>;
|
package/dist/initEmbeddedAuth.js
CHANGED
|
@@ -23,8 +23,8 @@ import { hasEmbeddedHandoffCompleted, isEmbeddedMode, tryResumeSession, } from '
|
|
|
23
23
|
* {@link ensureSignedInWithFabric} from a user-gesture handler for the
|
|
24
24
|
* non-embedded case.
|
|
25
25
|
*
|
|
26
|
-
* @param auth
|
|
27
|
-
* @param options
|
|
26
|
+
* @param auth - The Auth instance.
|
|
27
|
+
* @param options - Fabric authentication options.
|
|
28
28
|
* @returns The authenticated session, or `null` if not in embedded mode.
|
|
29
29
|
*/
|
|
30
30
|
export async function initEmbeddedAuth(auth, options) {
|
|
@@ -9,10 +9,10 @@ import type { FabricAuthOptions } from './types.js';
|
|
|
9
9
|
* `brokeredAuth.handoff` postMessage. On handoff, exchanges the code for
|
|
10
10
|
* tokens and creates a session. The `code_verifier` is kept in closure only.
|
|
11
11
|
*
|
|
12
|
-
* @param auth Auth instance for token exchange.
|
|
13
|
-
* @param options Broker auth options (`returnOrigin` required).
|
|
12
|
+
* @param auth - Auth instance for token exchange.
|
|
13
|
+
* @param options - Broker auth options (`returnOrigin` required).
|
|
14
14
|
* @returns Resolves when the session is established.
|
|
15
|
-
* @throws
|
|
15
|
+
* @throws `AuthError` - On missing options, blocked popup, or auth failure.
|
|
16
16
|
*/
|
|
17
17
|
export declare function initiateFabricLogin(auth: Auth, options: FabricAuthOptions): Promise<void>;
|
|
18
18
|
//# sourceMappingURL=initiateFabricLogin.d.ts.map
|
|
@@ -11,10 +11,10 @@ import { buildBrokerUrl } from './brokerUrl.js';
|
|
|
11
11
|
* `brokeredAuth.handoff` postMessage. On handoff, exchanges the code for
|
|
12
12
|
* tokens and creates a session. The `code_verifier` is kept in closure only.
|
|
13
13
|
*
|
|
14
|
-
* @param auth Auth instance for token exchange.
|
|
15
|
-
* @param options Broker auth options (`returnOrigin` required).
|
|
14
|
+
* @param auth - Auth instance for token exchange.
|
|
15
|
+
* @param options - Broker auth options (`returnOrigin` required).
|
|
16
16
|
* @returns Resolves when the session is established.
|
|
17
|
-
* @throws
|
|
17
|
+
* @throws `AuthError` - On missing options, blocked popup, or auth failure.
|
|
18
18
|
*/
|
|
19
19
|
export async function initiateFabricLogin(auth, options) {
|
|
20
20
|
// Validate required params
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/rayfin-auth-provider-fabric",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.33.0-beta.0",
|
|
4
4
|
"description": "Fabric brokered authentication provider for Rayfin SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
],
|
|
14
14
|
"type": "module",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@microsoft/rayfin-auth": "1.
|
|
17
|
-
"@microsoft/rayfin-lib": "1.
|
|
18
|
-
"@microsoft/fabric-embedded-host": "1.
|
|
16
|
+
"@microsoft/rayfin-auth": "1.33.0-beta.0",
|
|
17
|
+
"@microsoft/rayfin-lib": "1.33.0-beta.0",
|
|
18
|
+
"@microsoft/fabric-embedded-host": "1.33.0-beta.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"typescript": "^5.8.3",
|