authhero 9.31.0 → 9.34.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.
Files changed (71) hide show
  1. package/dist/assets/u/widget/index.esm.js +1 -1
  2. package/dist/authhero.cjs +137 -137
  3. package/dist/authhero.d.ts +605 -392
  4. package/dist/authhero.mjs +16303 -15968
  5. package/dist/mfa-CDFRupfM.mjs +128 -0
  6. package/dist/mfa-DF3O3Z8H.js +1 -0
  7. package/dist/mfa-attempts-BOWgbEPg.js +275 -0
  8. package/dist/{mfa-attempts-Dl3I8pop.mjs → mfa-attempts-C06Bkdy9.mjs} +14352 -13847
  9. package/dist/{passkey-enrollment-2Toeaevy.js → passkey-enrollment-RGw-WaSq.js} +1 -1
  10. package/dist/tsconfig.types.tsbuildinfo +1 -1
  11. package/dist/types/authentication-flows/common.d.ts +12 -1
  12. package/dist/types/authentication-flows/passwordless.d.ts +24 -11
  13. package/dist/types/authentication-flows/refresh-token.d.ts +1 -0
  14. package/dist/types/authentication-flows/remember-browser.d.ts +77 -0
  15. package/dist/types/constants.d.ts +1 -0
  16. package/dist/types/generated/locale-types.d.ts +6 -0
  17. package/dist/types/helpers/cimd.d.ts +8 -0
  18. package/dist/types/helpers/client.d.ts +25 -7
  19. package/dist/types/helpers/dcr/metadata-mapping.d.ts +1 -1
  20. package/dist/types/helpers/login-session-tenant.d.ts +22 -0
  21. package/dist/types/helpers/reserved-claims.d.ts +2 -2
  22. package/dist/types/helpers/session-transfer.d.ts +158 -0
  23. package/dist/types/hooks/lifecycle-codehooks.d.ts +1 -1
  24. package/dist/types/index.d.ts +536 -376
  25. package/dist/types/routes/auth-api/authorize.d.ts +6 -0
  26. package/dist/types/routes/auth-api/device.d.ts +8 -8
  27. package/dist/types/routes/auth-api/index.d.ts +49 -32
  28. package/dist/types/routes/auth-api/passwordless.d.ts +6 -6
  29. package/dist/types/routes/auth-api/register/index.d.ts +2 -2
  30. package/dist/types/routes/auth-api/revoke.d.ts +6 -6
  31. package/dist/types/routes/auth-api/token.d.ts +21 -10
  32. package/dist/types/routes/management-api/action-triggers.d.ts +25 -25
  33. package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
  34. package/dist/types/routes/management-api/clients.d.ts +100 -32
  35. package/dist/types/routes/management-api/connections.d.ts +25 -25
  36. package/dist/types/routes/management-api/custom-domains.d.ts +6 -6
  37. package/dist/types/routes/management-api/email-templates.d.ts +18 -18
  38. package/dist/types/routes/management-api/failed-events.d.ts +2 -2
  39. package/dist/types/routes/management-api/forms.d.ts +144 -144
  40. package/dist/types/routes/management-api/guardian.d.ts +5 -5
  41. package/dist/types/routes/management-api/helpers.d.ts +11 -1
  42. package/dist/types/routes/management-api/hooks.d.ts +21 -21
  43. package/dist/types/routes/management-api/index.d.ts +480 -337
  44. package/dist/types/routes/management-api/jobs.d.ts +2 -2
  45. package/dist/types/routes/management-api/keys.d.ts +12 -12
  46. package/dist/types/routes/management-api/logs.d.ts +4 -4
  47. package/dist/types/routes/management-api/organizations.d.ts +7 -7
  48. package/dist/types/routes/management-api/prompts.d.ts +4 -4
  49. package/dist/types/routes/management-api/refresh_tokens.d.ts +5 -0
  50. package/dist/types/routes/management-api/rollouts.d.ts +6 -6
  51. package/dist/types/routes/management-api/sessions.d.ts +5 -0
  52. package/dist/types/routes/management-api/tenant-export-import.d.ts +5 -5
  53. package/dist/types/routes/management-api/tenant-members.d.ts +8 -8
  54. package/dist/types/routes/management-api/tenant-operations.d.ts +4 -4
  55. package/dist/types/routes/management-api/tenants.d.ts +24 -16
  56. package/dist/types/routes/management-api/users.d.ts +84 -24
  57. package/dist/types/routes/universal-login/common.d.ts +57 -22
  58. package/dist/types/routes/universal-login/flow-api.d.ts +8 -8
  59. package/dist/types/routes/universal-login/identifier.d.ts +2 -2
  60. package/dist/types/routes/universal-login/index.d.ts +2 -2
  61. package/dist/types/routes/universal-login/screens/mfa-remember-browser.d.ts +28 -0
  62. package/dist/types/routes/universal-login/u2-index.d.ts +5 -5
  63. package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
  64. package/dist/types/state-machines/login-session.d.ts +7 -2
  65. package/dist/types/types/GrantFlowResult.d.ts +13 -0
  66. package/dist/types/types/Hooks.d.ts +24 -0
  67. package/dist/types/types/Variables.d.ts +12 -1
  68. package/dist/types/utils/cookies.d.ts +29 -0
  69. package/dist/types/utils/session-transfer-token.d.ts +56 -0
  70. package/package.json +6 -6
  71. package/dist/mfa-attempts-DXiY4U74.js +0 -275
@@ -1,4 +1,4 @@
1
- import { DataAdapters, LoginSession, RequestAuth } from "@authhero/adapter-interfaces";
1
+ import { DataAdapters, LoginSession, RequestAuth, SessionTransferProvenance } from "@authhero/adapter-interfaces";
2
2
  import { CountryCode } from "libphonenumber-js";
3
3
  import { Auth0Client } from "./Auth0Client";
4
4
  import type { PreferState } from "../middlewares/prefer";
@@ -80,4 +80,15 @@ export type Variables = {
80
80
  dur: number;
81
81
  }[];
82
82
  is_lazy_migration?: boolean;
83
+ client_id_from_token?: boolean;
84
+ session_transfer_token?: {
85
+ client_id: string;
86
+ scope?: string;
87
+ request: {
88
+ ip: string;
89
+ asn?: string;
90
+ user_agent?: string;
91
+ };
92
+ };
93
+ session_transfer?: SessionTransferProvenance;
83
94
  };
@@ -9,6 +9,20 @@
9
9
  * - Browser quirks in cookie ordering
10
10
  */
11
11
  export declare function getAllAuthCookies(tenant_id: string, cookieHeaders?: string): string[];
12
+ /**
13
+ * The remember-browser tokens (#1670) this browser holds for the tenant, from
14
+ * both cookie jars, without duplicates. The cookie carries one token per user
15
+ * who asked this browser to be remembered (newest first); base64url tokens
16
+ * never contain the separator. Values that aren't a generated token are
17
+ * skipped, and at most `MFA_REMEMBER_BROWSER_MAX_CANDIDATES` are returned.
18
+ */
19
+ export declare function getMfaRememberBrowserTokens(tenant_id: string, cookieHeaders?: string): string[];
20
+ /**
21
+ * Set-Cookie values that store the remember-browser tokens. Set like the
22
+ * session cookie (both jars, SameSite=None) so silent auth in an iframe and a
23
+ * login embedded in an iframe see it too.
24
+ */
25
+ export declare function serializeMfaRememberBrowserCookie(tenant_id: string, tokens: string[], maxAgeSeconds: number, hostname?: string): string[];
12
26
  export declare function getAuthCookie(tenant_id: string, cookieHeaders?: string): string | undefined;
13
27
  /**
14
28
  * Clears both the non-partitioned and the partitioned session cookie (see
@@ -78,3 +92,18 @@ export declare function getPrivateBrowsingCookie(cookieHeaders?: string): boolea
78
92
  */
79
93
  export declare function getLastUsedConnectionCookie(tenant_id: string, cookieHeaders?: string): string | undefined;
80
94
  export declare function serializeLastUsedConnectionCookie(tenant_id: string, connectionName: string, hostname?: string): string;
95
+ /**
96
+ * The session_transfer_token an application placed in the
97
+ * `auth0_session_transfer_token` cookie before sending the browser to
98
+ * /authorize (Auth0 "Native to Web SSO"). AuthHero never sets this cookie; the
99
+ * application does, on a domain it shares with the tenant.
100
+ */
101
+ export declare function getSessionTransferCookie(cookieHeaders?: string): string | undefined;
102
+ /**
103
+ * Expire the session transfer cookie once it has been presented. The token is
104
+ * single-use, so leaving it in the jar only makes every later /authorize log a
105
+ * failed transfer. The application chose the cookie's scope, which the request
106
+ * does not reveal, so both the host-only and the parent-domain variant are
107
+ * cleared. Returns Set-Cookie header values.
108
+ */
109
+ export declare function clearSessionTransferCookie(hostname?: string): string[];
@@ -0,0 +1,56 @@
1
+ /**
2
+ * The wire-level pieces of a session_transfer_token (#1710, Auth0 "Native to
3
+ * Web SSO"). Everything here is pure: no request context and no data adapters,
4
+ * so the logging helper can import it without a cycle.
5
+ */
6
+ /** `issued_token_type` of the exchange response. */
7
+ export declare const SESSION_TRANSFER_TOKEN_TYPE = "urn:auth0:params:oauth:token-type:session_transfer_token";
8
+ /** Query parameter that carries the token to /authorize. */
9
+ export declare const SESSION_TRANSFER_TOKEN_PARAM = "session_transfer_token";
10
+ /** Cookie that carries the token to /authorize. */
11
+ export declare const SESSION_TRANSFER_COOKIE_NAME = "auth0_session_transfer_token";
12
+ /** A token is valid for one minute and works once. */
13
+ export declare const SESSION_TRANSFER_TOKEN_TTL_SECONDS = 60;
14
+ /** `codes.code_type` of the stored token. */
15
+ export declare const SESSION_TRANSFER_CODE_TYPE = "session_transfer_token";
16
+ /**
17
+ * Header in which an authenticated confidential client with
18
+ * `session_transfer.trust_forwarded_ip` passes the end user's IP address.
19
+ */
20
+ export declare const SESSION_TRANSFER_FORWARDED_IP_HEADER = "auth0-forwarded-for";
21
+ /**
22
+ * A refresh-token exchange asks for a session_transfer_token by naming the
23
+ * audience `urn:{tenantDomain}:session_transfer`. The domain is not compared:
24
+ * the token is tenant-scoped and a tenant can be reached on several domains.
25
+ */
26
+ export declare function isSessionTransferAudience(audience: string | undefined): audience is string;
27
+ /** A fresh opaque token: 256 bits from the CSPRNG, base64url. */
28
+ export declare function generateSessionTransferToken(): string;
29
+ /**
30
+ * Only the SHA-256 of a token is stored, as the `code_id` it is looked up by,
31
+ * so a database read does not yield usable tokens.
32
+ */
33
+ export declare function hashSessionTransferToken(token: string): Promise<string>;
34
+ /**
35
+ * Remove the session_transfer_token from a URL before it is stored or handed
36
+ * to a hook, log or log stream: the parameter itself, and a `request`
37
+ * parameter whose Request Object carries the token. The token is a bearer
38
+ * credential for a session; a URL that never contained it is returned
39
+ * untouched.
40
+ */
41
+ export declare function stripSessionTransferToken(url: string): string;
42
+ export declare function stripSessionTransferToken(url: string | undefined): string | undefined;
43
+ /**
44
+ * Replace the token in a parsed query-string record (as logged with a request)
45
+ * with a placeholder: the parameter itself, and a `request` parameter whose
46
+ * Request Object carries the token. Returns the input when neither is there.
47
+ */
48
+ export declare function redactSessionTransferQuery<T>(query: Record<string, T>): Record<string, T | string>;
49
+ /**
50
+ * Canonical text form of an IP address, or undefined when the value is not
51
+ * one. Device binding compares canonical forms so the same address spelled two
52
+ * ways (`::FFFF:192.0.2.1` and `192.0.2.1`, upper and lower case hex, zero
53
+ * compression) still matches, and so a forwarded header cannot smuggle
54
+ * anything that is not an address into the stored record.
55
+ */
56
+ export declare function normalizeIp(value: string | undefined): string | undefined;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/sesamyab/authhero"
13
13
  },
14
- "version": "9.31.0",
14
+ "version": "9.34.0",
15
15
  "files": [
16
16
  "dist"
17
17
  ],
@@ -63,8 +63,8 @@
63
63
  "vite": "^8.0.14",
64
64
  "vite-plugin-dts": "^4.5.4",
65
65
  "vitest": "^4.1.7",
66
- "@authhero/kysely-adapter": "12.19.1",
67
- "@authhero/widget": "0.41.11"
66
+ "@authhero/kysely-adapter": "12.20.1",
67
+ "@authhero/widget": "0.41.13"
68
68
  },
69
69
  "dependencies": {
70
70
  "@peculiar/x509": "^1.14.3",
@@ -81,9 +81,9 @@
81
81
  "qrcode": "^1.5.4",
82
82
  "sanitize-html": "^2.17.4",
83
83
  "xstate": "^5.31.1",
84
- "@authhero/adapter-interfaces": "4.27.0",
85
- "@authhero/proxy": "0.11.14",
86
- "@authhero/saml": "0.6.7"
84
+ "@authhero/adapter-interfaces": "4.29.0",
85
+ "@authhero/proxy": "0.11.16",
86
+ "@authhero/saml": "0.6.9"
87
87
  },
88
88
  "peerDependencies": {
89
89
  "@authhero/widget": ">=0.38.9",