@auth0/auth0-server-js 1.9.0 → 1.11.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/README.md +40 -0
- package/dist/index.cjs +329 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +273 -3
- package/dist/index.d.ts +273 -3
- package/dist/index.js +330 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AuthorizationDetails, ExchangeProfileOptions, DiscoveryCacheOptions, TelemetryConfig, AuthClient, ListAuthenticatorsOptions, AuthenticatorResponse, EnrollAuthenticatorOptions, EnrollmentResponse, ChallengeOptions, ChallengeResponse, MfaVerifyOptions, PasskeySignupChallengeOptions, PasskeySignupChallengeResponse, PasskeyLoginChallengeOptions, PasskeyLoginChallengeResponse, GetTokenByPasskeyOptions, TokenResponse } from '@auth0/auth0-auth-js';
|
|
2
|
-
export { ActClaim, AuthenticatorResponse, AuthenticatorType, ChallengeOptions, ChallengeResponse, DiscoveryCacheOptions, EnrollAuthenticatorOptions, EnrollEmailOptions, EnrollOobOptions, EnrollOtpOptions, EnrollmentResponse, ListAuthenticatorsOptions, MfaChallengeError, MfaEnrollmentError, MfaFactorType, MfaListAuthenticatorsError, MfaRequirements, MfaVerifyError, MfaVerifyOobOptions, MfaVerifyOptions, MfaVerifyOtpOptions, MfaVerifyRecoveryCodeOptions, MissingClientAuthError, OobChannel, OobEnrollmentResponse, OrganizationValidationError, OtpEnrollmentResponse, PasskeyChallengeError, PasskeyLoginChallengeOptions as PasskeyChallengeOptions, PasskeyLoginChallengeResponse as PasskeyChallengeResponse, PasskeyCreationOptions, PasskeyCredentialResponse, PasskeyGetTokenError, GetTokenByPasskeyOptions as PasskeyGetTokenOptions, PasskeyRegisterError, PasskeySignupChallengeOptions as PasskeyRegisterOptions, PasskeySignupChallengeResponse as PasskeyRegisterResponse, PasskeyRequestOptions, TelemetryConfig, TokenExchangeError, TokenResponse, isMfaRequiredError } from '@auth0/auth0-auth-js';
|
|
1
|
+
import { ActClaim, AuthorizationDetails, ExchangeProfileOptions, DiscoveryCacheOptions, TelemetryConfig, AuthClient, ListAuthenticatorsOptions, AuthenticatorResponse, EnrollAuthenticatorOptions, EnrollmentResponse, ChallengeOptions, ChallengeResponse, MfaVerifyOptions, PasskeySignupChallengeOptions, PasskeySignupChallengeResponse, PasskeyLoginChallengeOptions, PasskeyLoginChallengeResponse, GetTokenByPasskeyOptions, SignUpOptions, SignUpResult, ChangePasswordOptions, TokenResponse } from '@auth0/auth0-auth-js';
|
|
2
|
+
export { ActClaim, AuthenticatorResponse, AuthenticatorType, ChallengeOptions, ChallengeResponse, ChangePasswordError, ChangePasswordOptions, DiscoveryCacheOptions, EnrollAuthenticatorOptions, EnrollEmailOptions, EnrollOobOptions, EnrollOtpOptions, EnrollmentResponse, ListAuthenticatorsOptions, MfaChallengeError, MfaEnrollmentError, MfaFactorType, MfaListAuthenticatorsError, MfaRequirements, MfaVerifyError, MfaVerifyOobOptions, MfaVerifyOptions, MfaVerifyOtpOptions, MfaVerifyRecoveryCodeOptions, MissingClientAuthError, OobChannel, OobEnrollmentResponse, OrganizationValidationError, OtpEnrollmentResponse, PasskeyChallengeError, PasskeyLoginChallengeOptions as PasskeyChallengeOptions, PasskeyLoginChallengeResponse as PasskeyChallengeResponse, PasskeyCreationOptions, PasskeyCredentialResponse, PasskeyGetTokenError, GetTokenByPasskeyOptions as PasskeyGetTokenOptions, PasskeyRegisterError, PasskeySignupChallengeOptions as PasskeyRegisterOptions, PasskeySignupChallengeResponse as PasskeyRegisterResponse, PasskeyRequestOptions, PasswordlessStartError, PasswordlessVerifyError, SignUpError, SignUpOptions, SignUpResult, TelemetryConfig, TokenExchangeError, TokenResponse, TokenRevocationError, isMfaRequiredError } from '@auth0/auth0-auth-js';
|
|
3
3
|
import { JWTPayload } from 'jose';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -64,6 +64,12 @@ interface UserClaims {
|
|
|
64
64
|
email_verified?: boolean;
|
|
65
65
|
org_id?: string;
|
|
66
66
|
org_name?: string;
|
|
67
|
+
/**
|
|
68
|
+
* The actor (`act`) claim, present when the session was established via impersonation
|
|
69
|
+
* (e.g. Custom Token Exchange Session Transfer). Identifies the acting party — read it
|
|
70
|
+
* to drive UI such as an impersonation banner.
|
|
71
|
+
*/
|
|
72
|
+
act?: ActClaim;
|
|
67
73
|
[key: string]: unknown;
|
|
68
74
|
}
|
|
69
75
|
interface AuthorizationParameters {
|
|
@@ -330,6 +336,13 @@ interface GetAccessTokenOptions {
|
|
|
330
336
|
*/
|
|
331
337
|
scope?: string;
|
|
332
338
|
}
|
|
339
|
+
interface RevokeRefreshTokenOptions {
|
|
340
|
+
/**
|
|
341
|
+
* Explicitly provide a refresh token to revoke.
|
|
342
|
+
* If omitted, the token stored in the current session is used.
|
|
343
|
+
*/
|
|
344
|
+
token?: string;
|
|
345
|
+
}
|
|
333
346
|
interface LogoutOptions {
|
|
334
347
|
returnTo: string;
|
|
335
348
|
}
|
|
@@ -408,6 +421,108 @@ interface LoginWithCustomTokenExchangeResult {
|
|
|
408
421
|
*/
|
|
409
422
|
authorizationDetails?: AuthorizationDetails[];
|
|
410
423
|
}
|
|
424
|
+
/**
|
|
425
|
+
* An explicit actor (the acting party) for a Session Transfer Token request.
|
|
426
|
+
*
|
|
427
|
+
* Supplying this overrides the default behaviour of sourcing the actor from the
|
|
428
|
+
* current agent session's ID token.
|
|
429
|
+
*/
|
|
430
|
+
interface SessionTransferActor {
|
|
431
|
+
/**
|
|
432
|
+
* The actor token — for the default flow this is the agent's ID token.
|
|
433
|
+
*/
|
|
434
|
+
token: string;
|
|
435
|
+
/**
|
|
436
|
+
* The actor token type URI. Defaults to the ID token URN when omitted
|
|
437
|
+
* (`urn:ietf:params:oauth:token-type:id_token`).
|
|
438
|
+
*/
|
|
439
|
+
type?: string;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Options for requesting a Session Transfer Token (STT) for impersonation via
|
|
443
|
+
* session transfer (Custom Token Exchange Release 2).
|
|
444
|
+
*
|
|
445
|
+
* The SDK fills in the protocol plumbing (audience, grant type, and the actor token
|
|
446
|
+
* pair). The `subjectToken` is always developer-supplied — it is your own proof of
|
|
447
|
+
* which customer to impersonate, validated only by your Action.
|
|
448
|
+
*
|
|
449
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8693 RFC 8693: OAuth 2.0 Token Exchange}
|
|
450
|
+
*/
|
|
451
|
+
interface RequestSessionTransferTokenOptions {
|
|
452
|
+
/**
|
|
453
|
+
* Your proof of which customer to impersonate — opaque to Auth0 and validated by
|
|
454
|
+
* your Action (which then calls `setUserById`). The SDK never produces it.
|
|
455
|
+
*/
|
|
456
|
+
subjectToken: string;
|
|
457
|
+
/**
|
|
458
|
+
* A URI identifying the type of the subject token, routing the request to your
|
|
459
|
+
* Token Exchange Profile / Action.
|
|
460
|
+
*/
|
|
461
|
+
subjectTokenType: string;
|
|
462
|
+
/**
|
|
463
|
+
* An explicit actor to override the default (the agent session's ID token).
|
|
464
|
+
*
|
|
465
|
+
* Resolution order: this explicit `actor` wins; otherwise the agent session's ID
|
|
466
|
+
* token is used (refreshed when expired); if neither is available the request fails
|
|
467
|
+
* client-side with a `TokenExchangeError` whose code is `actor_unavailable`, before
|
|
468
|
+
* any network call.
|
|
469
|
+
*/
|
|
470
|
+
actor?: SessionTransferActor;
|
|
471
|
+
/**
|
|
472
|
+
* Space-separated list of OAuth 2.0 scopes to request for the session's tokens.
|
|
473
|
+
*/
|
|
474
|
+
scope?: string;
|
|
475
|
+
/**
|
|
476
|
+
* Additional custom parameters forwarded to the token endpoint (and thus to your
|
|
477
|
+
* Action via `event.request.body`). Cannot override reserved OAuth parameters.
|
|
478
|
+
*/
|
|
479
|
+
extra?: Record<string, string | string[]>;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Options for {@link ServerClient.buildSessionTransferRedirect}.
|
|
483
|
+
*/
|
|
484
|
+
interface BuildSessionTransferRedirectOptions {
|
|
485
|
+
/**
|
|
486
|
+
* The organization identifier to forward to the target's `/authorize` (as the
|
|
487
|
+
* `organization` query parameter). Required only when the STT was issued in an
|
|
488
|
+
* organization context.
|
|
489
|
+
*/
|
|
490
|
+
organization?: string;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* The result of requesting a Session Transfer Token (STT) for impersonation via
|
|
494
|
+
* session transfer (Custom Token Exchange).
|
|
495
|
+
*
|
|
496
|
+
* The STT is opaque, single-use, and short-lived (~60s). Hand it to
|
|
497
|
+
* {@link ServerClient.buildSessionTransferRedirect} and do not decode, cache, or persist
|
|
498
|
+
* it. The `act` claim is deliberately not on this result — it only appears on the tokens
|
|
499
|
+
* of the session established after the STT is redeemed at `/authorize`.
|
|
500
|
+
*/
|
|
501
|
+
interface SessionTransferTokenResult {
|
|
502
|
+
/**
|
|
503
|
+
* The opaque, single-use Session Transfer Token. Never decode, cache, or persist it.
|
|
504
|
+
*/
|
|
505
|
+
sessionTransferToken: string;
|
|
506
|
+
/**
|
|
507
|
+
* The issued token type URI — the session-transfer URN
|
|
508
|
+
* (`urn:auth0:params:oauth:token-type:session_transfer_token`). Branch on this,
|
|
509
|
+
* never on {@link SessionTransferTokenResult.tokenType}.
|
|
510
|
+
*/
|
|
511
|
+
issuedTokenType: string;
|
|
512
|
+
/**
|
|
513
|
+
* The token lifetime in seconds (typically ~60).
|
|
514
|
+
*/
|
|
515
|
+
expiresIn: number;
|
|
516
|
+
/**
|
|
517
|
+
* The token type as returned by the server (typically `"N_A"`). Informational only —
|
|
518
|
+
* never branch on it.
|
|
519
|
+
*/
|
|
520
|
+
tokenType?: string;
|
|
521
|
+
/**
|
|
522
|
+
* The granted scopes, when returned by the server.
|
|
523
|
+
*/
|
|
524
|
+
scope?: string;
|
|
525
|
+
}
|
|
411
526
|
interface SessionCookieOptions {
|
|
412
527
|
/**
|
|
413
528
|
* The name of the session cookie.
|
|
@@ -602,6 +717,59 @@ declare class ServerPasskeyClient<TStoreOptions = unknown> {
|
|
|
602
717
|
getToken(options: GetTokenByPasskeyOptions, storeOptions?: TStoreOptions): Promise<PasskeyGetTokenResult>;
|
|
603
718
|
}
|
|
604
719
|
|
|
720
|
+
/**
|
|
721
|
+
* @internal
|
|
722
|
+
* Options for constructing a ServerDatabaseClient.
|
|
723
|
+
*
|
|
724
|
+
* Like the passkey client, the database client resolves the domain per call so
|
|
725
|
+
* it keeps working in resolver (multi-tenant) mode. It therefore receives the
|
|
726
|
+
* parent client's `resolveDomain` and `getAuthClient` helpers instead of a
|
|
727
|
+
* fixed domain/authClient. Unlike the MFA/passkey clients, it never touches the
|
|
728
|
+
* state store — signup and change-password write no session.
|
|
729
|
+
*/
|
|
730
|
+
interface ServerDatabaseClientOptions<TStoreOptions = unknown> {
|
|
731
|
+
resolveDomain: (storeOptions?: TStoreOptions) => Promise<string>;
|
|
732
|
+
getAuthClient: (domain: string) => AuthClient;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
declare class ServerDatabaseClient<TStoreOptions = unknown> {
|
|
736
|
+
#private;
|
|
737
|
+
/**
|
|
738
|
+
* @internal
|
|
739
|
+
*/
|
|
740
|
+
constructor(options: ServerDatabaseClientOptions<TStoreOptions>);
|
|
741
|
+
/**
|
|
742
|
+
* Registers a new user in a database connection.
|
|
743
|
+
*
|
|
744
|
+
* Delegates to the underlying `AuthClient.database.signUp` without any session
|
|
745
|
+
* state modification. The caller is responsible for handling the returned user
|
|
746
|
+
* data as needed.
|
|
747
|
+
*
|
|
748
|
+
* @param options The signup options (email, password, connection, etc.).
|
|
749
|
+
* @param storeOptions Optional options used to resolve the domain (resolver mode).
|
|
750
|
+
*
|
|
751
|
+
* @throws {SignUpError} If there was an issue signing the user up.
|
|
752
|
+
*
|
|
753
|
+
* @returns A promise resolving to the created user result with a normalized `id` field.
|
|
754
|
+
*/
|
|
755
|
+
signUp(options: SignUpOptions, storeOptions?: TStoreOptions): Promise<SignUpResult>;
|
|
756
|
+
/**
|
|
757
|
+
* Requests a password-change email for a database connection user.
|
|
758
|
+
*
|
|
759
|
+
* Delegates to the underlying `AuthClient.database.changePassword` without any
|
|
760
|
+
* session state modification. The caller is responsible for informing the user
|
|
761
|
+
* of the sent email as needed.
|
|
762
|
+
*
|
|
763
|
+
* @param options The password change options (email, connection, organization, etc.).
|
|
764
|
+
* @param storeOptions Optional options used to resolve the domain (resolver mode).
|
|
765
|
+
*
|
|
766
|
+
* @throws {ChangePasswordError} If there was an issue requesting the password change.
|
|
767
|
+
*
|
|
768
|
+
* @returns A promise resolving to the server's plain-text confirmation message.
|
|
769
|
+
*/
|
|
770
|
+
changePassword(options: ChangePasswordOptions, storeOptions?: TStoreOptions): Promise<string>;
|
|
771
|
+
}
|
|
772
|
+
|
|
605
773
|
declare class ServerClient<TStoreOptions = unknown> {
|
|
606
774
|
#private;
|
|
607
775
|
/**
|
|
@@ -639,6 +807,19 @@ declare class ServerClient<TStoreOptions = unknown> {
|
|
|
639
807
|
* and `getToken()` so the credential is exchanged against the tenant that issued it.
|
|
640
808
|
*/
|
|
641
809
|
get passkey(): ServerPasskeyClient<TStoreOptions>;
|
|
810
|
+
/**
|
|
811
|
+
* The database client for self-service sign-up and password-change requests
|
|
812
|
+
* against an Auth0 database connection.
|
|
813
|
+
*
|
|
814
|
+
* Provides `signUp()` to register a user and `changePassword()` to request a
|
|
815
|
+
* password-reset email. Both are pure passthrough operations to the Auth0
|
|
816
|
+
* Authentication API — they never read or write the session/state store.
|
|
817
|
+
*
|
|
818
|
+
* Like `passkey`, this property is available in both static and resolver
|
|
819
|
+
* (multi-tenant) domain modes. In resolver mode, pass `storeOptions` so the
|
|
820
|
+
* request resolves the intended tenant.
|
|
821
|
+
*/
|
|
822
|
+
get database(): ServerDatabaseClient<TStoreOptions>;
|
|
642
823
|
constructor(options: ServerClientOptions<TStoreOptions>);
|
|
643
824
|
/**
|
|
644
825
|
* Starts the interactive login process, and returns a URL to redirect the user-agent to to request authorization at Auth0.
|
|
@@ -850,6 +1031,22 @@ declare class ServerClient<TStoreOptions = unknown> {
|
|
|
850
1031
|
* @returns The Connection Token Set, containing the access token for the connection, as well as additional information.
|
|
851
1032
|
*/
|
|
852
1033
|
getAccessTokenForConnection(options: AccessTokenForConnectionOptions, storeOptions?: TStoreOptions): Promise<ConnectionTokenSet>;
|
|
1034
|
+
/**
|
|
1035
|
+
* Revokes the refresh token stored in the current session, or an explicitly supplied token.
|
|
1036
|
+
*
|
|
1037
|
+
* In resolver mode, revocation only occurs when the session domain matches the domain resolved
|
|
1038
|
+
* for the current request. If the domains differ (or the session has no stored domain), the call
|
|
1039
|
+
* returns without revoking to avoid sending a token to the wrong tenant. This guard applies even
|
|
1040
|
+
* when a token is passed explicitly via `options.token`.
|
|
1041
|
+
*
|
|
1042
|
+
* @param options Optionally supply a token to revoke instead of reading from the session.
|
|
1043
|
+
* @param storeOptions Optional options passed to the StateStore.
|
|
1044
|
+
*
|
|
1045
|
+
* @throws {MissingRequiredArgumentError} If `options.token` is an empty string.
|
|
1046
|
+
* @throws {MissingSessionError} If no refresh token is found in the session and none was provided.
|
|
1047
|
+
* @throws {TokenRevocationError} If the revocation request fails.
|
|
1048
|
+
*/
|
|
1049
|
+
revokeRefreshToken(options?: RevokeRefreshTokenOptions, storeOptions?: TStoreOptions): Promise<void>;
|
|
853
1050
|
/**
|
|
854
1051
|
* Logs the user out and returns a URL to redirect the user-agent to after they log out.
|
|
855
1052
|
* @param options Options used to configure the logout process.
|
|
@@ -896,6 +1093,54 @@ declare class ServerClient<TStoreOptions = unknown> {
|
|
|
896
1093
|
* @returns A promise resolving to the token response from Auth0.
|
|
897
1094
|
*/
|
|
898
1095
|
customTokenExchange(options: CustomTokenExchangeOptions, storeOptions?: TStoreOptions): Promise<TokenResponse>;
|
|
1096
|
+
/**
|
|
1097
|
+
* Requests a Session Transfer Token (STT) for impersonation via session transfer (RFC 8693).
|
|
1098
|
+
*
|
|
1099
|
+
* Performs a Custom Token Exchange against the `urn:{domain}:session_transfer` audience and
|
|
1100
|
+
* returns the resulting STT. The audience is built from the SDK's resolved request domain, so
|
|
1101
|
+
* it is correct under multiple custom domains. The returned STT is opaque and single-use — hand
|
|
1102
|
+
* it to {@link ServerClient.buildSessionTransferRedirect} and do not decode, cache, or persist
|
|
1103
|
+
* it. This method writes nothing to the state store for the STT itself; the `act` claim is not
|
|
1104
|
+
* on the result — it only appears on the target session's tokens once the STT is redeemed.
|
|
1105
|
+
*
|
|
1106
|
+
* An actor is mandatory for an STT (this is what makes it auditable impersonation). It is
|
|
1107
|
+
* resolved in this order: an explicit `options.actor` wins; otherwise the current agent
|
|
1108
|
+
* session's ID token is used, refreshed when it has expired; if neither is available the method
|
|
1109
|
+
* throws before any network call.
|
|
1110
|
+
*
|
|
1111
|
+
* @param options Options including the developer-supplied `subjectToken`/`subjectTokenType` and an optional explicit `actor`.
|
|
1112
|
+
* @param storeOptions Optional options used to read the agent session (for the actor) and resolve the request domain.
|
|
1113
|
+
*
|
|
1114
|
+
* @throws {TokenExchangeError} With code `actor_unavailable` when no explicit actor is given and no usable session ID token can be resolved — no logged-in agent, a session that belongs to a different domain in resolver mode, or an expired ID token that cannot be refreshed (raised client-side, before any network call). With the default code when the exchange itself fails; a server-side `setactor_required` or `session_transfer_disabled` condition is surfaced via `cause.error` / `cause.error_description`.
|
|
1115
|
+
* @throws {MissingClientAuthError} When client credentials are not configured (STT requires a confidential client).
|
|
1116
|
+
* @throws {MissingRequiredArgumentError} When `subjectToken` or `subjectTokenType` is missing or blank (raised before any session read or network call).
|
|
1117
|
+
*
|
|
1118
|
+
* @returns A promise resolving to a {@link SessionTransferTokenResult} containing the STT and its metadata.
|
|
1119
|
+
*/
|
|
1120
|
+
requestSessionTransferToken(options: RequestSessionTransferTokenOptions, storeOptions?: TStoreOptions): Promise<SessionTransferTokenResult>;
|
|
1121
|
+
/**
|
|
1122
|
+
* Builds the redirect URL that hands a Session Transfer Token (STT) to the target app's login URL.
|
|
1123
|
+
*
|
|
1124
|
+
* Returns `targetLoginUrl` with `session_transfer_token` (and `organization`, when provided)
|
|
1125
|
+
* appended as query parameters, URL-encoded. This performs no network call and writes nothing
|
|
1126
|
+
* to the session — it only builds a string. The developer hands the returned URL to their
|
|
1127
|
+
* framework's redirect.
|
|
1128
|
+
*
|
|
1129
|
+
* `targetLoginUrl` attaches a single-use credential, so it must be a trusted, app-controlled
|
|
1130
|
+
* value — never derived from untrusted input (e.g. a `returnTo`), or the token could leak to an
|
|
1131
|
+
* attacker host. To harden against that, the URL must be absolute and use `https:` (an `http:`
|
|
1132
|
+
* URL is accepted only for `localhost` / loopback, to support local development).
|
|
1133
|
+
*
|
|
1134
|
+
* @param targetLoginUrl The target app's login URL (absolute, https).
|
|
1135
|
+
* @param result The {@link SessionTransferTokenResult} from {@link ServerClient.requestSessionTransferToken}.
|
|
1136
|
+
* @param options Optional options, e.g. the `organization` to forward when the STT is org-scoped.
|
|
1137
|
+
*
|
|
1138
|
+
* @throws {MissingRequiredArgumentError} When `targetLoginUrl` is missing or blank.
|
|
1139
|
+
* @throws {InvalidConfigurationError} When `targetLoginUrl` is not an absolute URL, or does not use `https:` (except for loopback hosts).
|
|
1140
|
+
*
|
|
1141
|
+
* @returns A {@link URL} with the STT (and optional organization) as query parameters.
|
|
1142
|
+
*/
|
|
1143
|
+
buildSessionTransferRedirect(targetLoginUrl: string, result: SessionTransferTokenResult, options?: BuildSessionTransferRedirectOptions): URL;
|
|
899
1144
|
/**
|
|
900
1145
|
* Handles the backchannel logout process by verifying the logout token and deleting the session from the store if the logout token was considered valid.
|
|
901
1146
|
* @param logoutToken The logout token to verify and use to delete the session from the store.
|
|
@@ -1033,6 +1278,31 @@ declare class StatelessStateStore<TStoreOptions> extends AbstractSessionStore<TS
|
|
|
1033
1278
|
private getCookieKeys;
|
|
1034
1279
|
}
|
|
1035
1280
|
|
|
1281
|
+
/**
|
|
1282
|
+
* Codes carried on the `code` field of a `TokenExchangeError` raised by the Session
|
|
1283
|
+
* Transfer Token (STT) flow. These are specific to Custom Token Exchange Impersonation
|
|
1284
|
+
* via Session Transfer:
|
|
1285
|
+
*
|
|
1286
|
+
* - `actor_unavailable` — raised client-side, before any network call, when a Session
|
|
1287
|
+
* Transfer Token is requested but no actor could be resolved (no explicit actor and
|
|
1288
|
+
* no usable session ID token).
|
|
1289
|
+
* - `setactor_required` — the server rejected the exchange because the Action did not
|
|
1290
|
+
* call `setActor` (an actor is mandatory for a Session Transfer Token).
|
|
1291
|
+
* - `session_transfer_disabled` — the server rejected the exchange because the tenant
|
|
1292
|
+
* feature flag is off.
|
|
1293
|
+
*
|
|
1294
|
+
* Only `actor_unavailable` is raised by the SDK itself. `setactor_required` and
|
|
1295
|
+
* `session_transfer_disabled` are surfaced from the raw server response via the
|
|
1296
|
+
* error's `cause.error` / `cause.error_description`; they are defined here as named
|
|
1297
|
+
* constants for documentation and for the day the platform returns a machine-readable
|
|
1298
|
+
* code.
|
|
1299
|
+
*/
|
|
1300
|
+
declare const TokenExchangeErrorCode: {
|
|
1301
|
+
readonly ACTOR_UNAVAILABLE: "actor_unavailable";
|
|
1302
|
+
readonly SETACTOR_REQUIRED: "setactor_required";
|
|
1303
|
+
readonly SESSION_TRANSFER_DISABLED: "session_transfer_disabled";
|
|
1304
|
+
};
|
|
1305
|
+
type TokenExchangeErrorCode = (typeof TokenExchangeErrorCode)[keyof typeof TokenExchangeErrorCode];
|
|
1036
1306
|
/**
|
|
1037
1307
|
* Error thrown when there is no transaction available.
|
|
1038
1308
|
*/
|
|
@@ -1091,4 +1361,4 @@ declare class SessionExpiredError extends Error {
|
|
|
1091
1361
|
constructor(message?: string);
|
|
1092
1362
|
}
|
|
1093
1363
|
|
|
1094
|
-
export { type AbstractDataStore, AbstractStateStore, AbstractTransactionStore, type AccessTokenForConnectionOptions, type AuthorizationParameters, BackchannelLogoutError, type CompletePasswordlessEmailOptions, type CompletePasswordlessOptions, type CompletePasswordlessResult, type CompletePasswordlessSmsOptions, type ConnectionTokenSet, type CookieHandler, type CookieSerializeOptions, CookieTransactionStore, type CustomTokenExchangeOptions, type DomainResolver, type EncryptedStoreOptions, type GetAccessTokenOptions, type InternalStateData, InvalidConfigurationError, IssuerValidationError, type LoginBackchannelOptions, type LoginBackchannelResult, type LoginWithCustomTokenExchangeOptions, type LoginWithCustomTokenExchangeResult, type LogoutOptions, type LogoutTokenClaims, type MfaVerifyResponse, MissingRequiredArgumentError, MissingSessionError, MissingTransactionError, type PasskeyGetTokenResult, ServerClient, type ServerClientOptions, ServerMfaClient, ServerPasskeyClient, type SessionConfiguration, type SessionCookieOptions, type SessionData, SessionExpiredError, type SessionStore, type StartInteractiveLoginOptions, StartLinkUserError, type StartLinkUserOptions, type StartPasswordlessEmailCodeOptions, type StartPasswordlessEmailLinkOptions, type StartPasswordlessOptions, type StartPasswordlessSmsOptions, type StartUnlinkUserOptions, type StateData, type StateStore, StatefulStateStore, type StatefulStateStoreOptions, StatelessStateStore, type TokenSet, type TransactionData, type TransactionStore, type UserClaims };
|
|
1364
|
+
export { type AbstractDataStore, AbstractStateStore, AbstractTransactionStore, type AccessTokenForConnectionOptions, type AuthorizationParameters, BackchannelLogoutError, type BuildSessionTransferRedirectOptions, type CompletePasswordlessEmailOptions, type CompletePasswordlessOptions, type CompletePasswordlessResult, type CompletePasswordlessSmsOptions, type ConnectionTokenSet, type CookieHandler, type CookieSerializeOptions, CookieTransactionStore, type CustomTokenExchangeOptions, type DomainResolver, type EncryptedStoreOptions, type GetAccessTokenOptions, type InternalStateData, InvalidConfigurationError, IssuerValidationError, type LoginBackchannelOptions, type LoginBackchannelResult, type LoginWithCustomTokenExchangeOptions, type LoginWithCustomTokenExchangeResult, type LogoutOptions, type LogoutTokenClaims, type MfaVerifyResponse, MissingRequiredArgumentError, MissingSessionError, MissingTransactionError, type PasskeyGetTokenResult, type RequestSessionTransferTokenOptions, type RevokeRefreshTokenOptions, ServerClient, type ServerClientOptions, ServerDatabaseClient, ServerMfaClient, ServerPasskeyClient, type SessionConfiguration, type SessionCookieOptions, type SessionData, SessionExpiredError, type SessionStore, type SessionTransferActor, type SessionTransferTokenResult, type StartInteractiveLoginOptions, StartLinkUserError, type StartLinkUserOptions, type StartPasswordlessEmailCodeOptions, type StartPasswordlessEmailLinkOptions, type StartPasswordlessOptions, type StartPasswordlessSmsOptions, type StartUnlinkUserOptions, type StateData, type StateStore, StatefulStateStore, type StatefulStateStoreOptions, StatelessStateStore, TokenExchangeErrorCode, type TokenSet, type TransactionData, type TransactionStore, type UserClaims };
|