@better-auth/sso 1.5.0-beta.13 → 1.5.0-beta.16

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.
@@ -1,20 +1,20 @@
1
1
 
2
- > @better-auth/sso@1.5.0-beta.13 build /home/runner/work/better-auth/better-auth/packages/sso
2
+ > @better-auth/sso@1.5.0-beta.16 build /home/runner/work/better-auth/better-auth/packages/sso
3
3
  > tsdown
4
4
 
5
- ℹ tsdown v0.20.1 powered by rolldown v1.0.0-rc.1
5
+ ℹ tsdown v0.20.3 powered by rolldown v1.0.0-rc.3
6
6
  ℹ config file: /home/runner/work/better-auth/better-auth/packages/sso/tsdown.config.ts
7
7
  ℹ entry: src/index.ts, src/client.ts
8
8
  ℹ tsconfig: tsconfig.json
9
9
  ℹ Build start
10
- ℹ dist/index.mjs 121.90 kB │ gzip: 24.04 kB
11
- ℹ dist/client.mjs  0.28 kB │ gzip: 0.21 kB
12
- ℹ dist/index.mjs.map 246.25 kB │ gzip: 46.78 kB
13
- ℹ dist/client.mjs.map  0.94 kB │ gzip: 0.50 kB
14
- ℹ dist/index.d.mts  1.67 kB │ gzip: 0.57 kB
15
- ℹ dist/client.d.mts  0.62 kB │ gzip: 0.36 kB
16
- ℹ dist/index-DCUy0gtM.d.mts  56.16 kB │ gzip: 9.96 kB
17
- ℹ 7 files, total: 427.81 kB
10
+ ℹ dist/index.mjs 139.98 kB │ gzip: 27.81 kB
11
+ ℹ dist/client.mjs  0.27 kB │ gzip: 0.21 kB
12
+ ℹ dist/index.mjs.map 280.86 kB │ gzip: 53.94 kB
13
+ ℹ dist/client.mjs.map  0.93 kB │ gzip: 0.50 kB
14
+ ℹ dist/index.d.mts  3.79 kB │ gzip: 1.20 kB
15
+ ℹ dist/client.d.mts  0.63 kB │ gzip: 0.36 kB
16
+ ℹ dist/index-CbKvQr9M.d.mts  58.40 kB │ gzip: 10.28 kB
17
+ ℹ 7 files, total: 484.85 kB
18
18
  [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugin `rolldown-plugin-dts:generate`. See https://rolldown.rs/options/checks#plugintimings for more details.
19
19
 
20
- ✔ Build complete in 29829ms
20
+ ✔ Build complete in 31855ms
package/dist/client.d.mts CHANGED
@@ -1,4 +1,5 @@
1
- import { t as SSOPlugin } from "./index-DCUy0gtM.mjs";
1
+ import "./index-CbKvQr9M.mjs";
2
+ import { SSOPlugin } from "./index.mjs";
2
3
 
3
4
  //#region src/client.d.ts
4
5
  interface SSOClientOptions {
@@ -17,7 +18,7 @@ declare const ssoClient: <CO extends SSOClientOptions>(options?: CO | undefined)
17
18
  }>;
18
19
  pathMethods: {
19
20
  "/sso/providers": "GET";
20
- "/sso/providers/:providerId": "GET";
21
+ "/sso/get-provider": "GET";
21
22
  };
22
23
  };
23
24
  //#endregion
package/dist/client.mjs CHANGED
@@ -5,7 +5,7 @@ const ssoClient = (options) => {
5
5
  $InferServerPlugin: {},
6
6
  pathMethods: {
7
7
  "/sso/providers": "GET",
8
- "/sso/providers/:providerId": "GET"
8
+ "/sso/get-provider": "GET"
9
9
  }
10
10
  };
11
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"client.mjs","names":[],"sources":["../src/client.ts"],"sourcesContent":["import type { BetterAuthClientPlugin } from \"better-auth/client\";\nimport type { SSOPlugin } from \"./index\";\n\ninterface SSOClientOptions {\n\tdomainVerification?:\n\t\t| {\n\t\t\t\tenabled: boolean;\n\t\t }\n\t\t| undefined;\n}\n\nexport const ssoClient = <CO extends SSOClientOptions>(\n\toptions?: CO | undefined,\n) => {\n\treturn {\n\t\tid: \"sso-client\",\n\t\t$InferServerPlugin: {} as SSOPlugin<{\n\t\t\tdomainVerification: {\n\t\t\t\tenabled: CO[\"domainVerification\"] extends { enabled: true }\n\t\t\t\t\t? true\n\t\t\t\t\t: false;\n\t\t\t};\n\t\t}>,\n\t\tpathMethods: {\n\t\t\t\"/sso/providers\": \"GET\",\n\t\t\t\"/sso/providers/:providerId\": \"GET\",\n\t\t},\n\t} satisfies BetterAuthClientPlugin;\n};\n"],"mappings":";AAWA,MAAa,aACZ,YACI;AACJ,QAAO;EACN,IAAI;EACJ,oBAAoB,EAAE;EAOtB,aAAa;GACZ,kBAAkB;GAClB,8BAA8B;GAC9B;EACD"}
1
+ {"version":3,"file":"client.mjs","names":[],"sources":["../src/client.ts"],"sourcesContent":["import type { BetterAuthClientPlugin } from \"better-auth/client\";\nimport type { SSOPlugin } from \"./index\";\n\ninterface SSOClientOptions {\n\tdomainVerification?:\n\t\t| {\n\t\t\t\tenabled: boolean;\n\t\t }\n\t\t| undefined;\n}\n\nexport const ssoClient = <CO extends SSOClientOptions>(\n\toptions?: CO | undefined,\n) => {\n\treturn {\n\t\tid: \"sso-client\",\n\t\t$InferServerPlugin: {} as SSOPlugin<{\n\t\t\tdomainVerification: {\n\t\t\t\tenabled: CO[\"domainVerification\"] extends { enabled: true }\n\t\t\t\t\t? true\n\t\t\t\t\t: false;\n\t\t\t};\n\t\t}>,\n\t\tpathMethods: {\n\t\t\t\"/sso/providers\": \"GET\",\n\t\t\t\"/sso/get-provider\": \"GET\",\n\t\t},\n\t} satisfies BetterAuthClientPlugin;\n};\n"],"mappings":";AAWA,MAAa,aACZ,YACI;AACJ,QAAO;EACN,IAAI;EACJ,oBAAoB,EAAE;EAOtB,aAAa;GACZ,kBAAkB;GAClB,qBAAqB;GACrB;EACD"}
@@ -1,7 +1,7 @@
1
1
  import { APIError } from "better-auth/api";
2
2
  import * as z$1 from "zod/v4";
3
3
  import z from "zod/v4";
4
- import { Awaitable, BetterAuthPlugin, OAuth2Tokens, User } from "better-auth";
4
+ import { Awaitable, OAuth2Tokens, User } from "better-auth";
5
5
  import * as better_call0 from "better-call";
6
6
 
7
7
  //#region src/saml/algorithms.d.ts
@@ -97,6 +97,10 @@ interface SAMLConfig {
97
97
  Binding: string;
98
98
  Location: string;
99
99
  }>;
100
+ singleLogoutService?: Array<{
101
+ Binding: string;
102
+ Location: string;
103
+ }>;
100
104
  } | undefined;
101
105
  spMetadata: {
102
106
  metadata?: string | undefined;
@@ -279,12 +283,20 @@ interface SSOOptions {
279
283
  */
280
284
  enabled?: boolean;
281
285
  /**
282
- * Prefix used to generate the domain verification token
286
+ * Prefix used to generate the domain verification token.
287
+ * An underscore is automatically prepended to follow DNS
288
+ * infrastructure subdomain conventions (RFC 8552), so do
289
+ * not include a leading underscore.
283
290
  *
284
- * @default "better-auth-token-"
291
+ * @default "better-auth-token"
285
292
  */
286
293
  tokenPrefix?: string;
287
294
  };
295
+ /**
296
+ * A shared redirect URI used by all OIDC providers instead of
297
+ * per-provider callback URLs. Can be a path or a full URL.
298
+ */
299
+ redirectURI?: string;
288
300
  /**
289
301
  * SAML security options for AuthnRequest/InResponseTo validation.
290
302
  * This prevents unsolicited responses, replay attacks, and cross-provider injection.
@@ -380,6 +392,26 @@ interface SSOOptions {
380
392
  * @default 102400 (100KB)
381
393
  */
382
394
  maxMetadataSize?: number;
395
+ /**
396
+ * Enable SAML Single Logout
397
+ * @default false
398
+ */
399
+ enableSingleLogout?: boolean;
400
+ /**
401
+ * TTL for LogoutRequest records in milliseconds
402
+ * @default 300000 (5 minutes)
403
+ */
404
+ logoutRequestTTL?: number;
405
+ /**
406
+ * Require signed LogoutRequests from IdP
407
+ * @default false
408
+ */
409
+ wantLogoutRequestSigned?: boolean;
410
+ /**
411
+ * Require signed LogoutResponses from IdP
412
+ * @default false
413
+ */
414
+ wantLogoutResponseSigned?: boolean;
383
415
  };
384
416
  }
385
417
  //#endregion
@@ -560,7 +592,7 @@ declare const listSSOProviders: () => better_call0.StrictEndpoint<"/sso/provider
560
592
  spMetadataUrl: string;
561
593
  }[];
562
594
  }>;
563
- declare const getSSOProvider: () => better_call0.StrictEndpoint<"/sso/providers/:providerId", {
595
+ declare const getSSOProvider: () => better_call0.StrictEndpoint<"/sso/get-provider", {
564
596
  method: "GET";
565
597
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
566
598
  session: {
@@ -585,7 +617,7 @@ declare const getSSOProvider: () => better_call0.StrictEndpoint<"/sso/providers/
585
617
  };
586
618
  };
587
619
  }>)[];
588
- params: z.ZodObject<{
620
+ query: z.ZodObject<{
589
621
  providerId: z.ZodString;
590
622
  }, z.core.$strip>;
591
623
  metadata: {
@@ -644,8 +676,8 @@ declare const getSSOProvider: () => better_call0.StrictEndpoint<"/sso/providers/
644
676
  } | undefined;
645
677
  spMetadataUrl: string;
646
678
  }>;
647
- declare const updateSSOProvider: (options: SSOOptions) => better_call0.StrictEndpoint<"/sso/providers/:providerId", {
648
- method: "PATCH";
679
+ declare const updateSSOProvider: (options: SSOOptions) => better_call0.StrictEndpoint<"/sso/update-provider", {
680
+ method: "POST";
649
681
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
650
682
  session: {
651
683
  session: Record<string, any> & {
@@ -669,9 +701,6 @@ declare const updateSSOProvider: (options: SSOOptions) => better_call0.StrictEnd
669
701
  };
670
702
  };
671
703
  }>)[];
672
- params: z.ZodObject<{
673
- providerId: z.ZodString;
674
- }, z.core.$strip>;
675
704
  body: z.ZodObject<{
676
705
  issuer: z.ZodOptional<z.ZodString>;
677
706
  domain: z.ZodOptional<z.ZodString>;
@@ -746,6 +775,7 @@ declare const updateSSOProvider: (options: SSOOptions) => better_call0.StrictEnd
746
775
  extraFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
747
776
  }, z.core.$strip>>;
748
777
  }, z.core.$strip>>;
778
+ providerId: z.ZodString;
749
779
  }, z.core.$strip>;
750
780
  metadata: {
751
781
  openapi: {
@@ -803,8 +833,8 @@ declare const updateSSOProvider: (options: SSOOptions) => better_call0.StrictEnd
803
833
  } | undefined;
804
834
  spMetadataUrl: string;
805
835
  }>;
806
- declare const deleteSSOProvider: () => better_call0.StrictEndpoint<"/sso/providers/:providerId", {
807
- method: "DELETE";
836
+ declare const deleteSSOProvider: () => better_call0.StrictEndpoint<"/sso/delete-provider", {
837
+ method: "POST";
808
838
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
809
839
  session: {
810
840
  session: Record<string, any> & {
@@ -828,7 +858,7 @@ declare const deleteSSOProvider: () => better_call0.StrictEndpoint<"/sso/provide
828
858
  };
829
859
  };
830
860
  }>)[];
831
- params: z.ZodObject<{
861
+ body: z.ZodObject<{
832
862
  providerId: z.ZodString;
833
863
  }, z.core.$strip>;
834
864
  metadata: {
@@ -872,7 +902,7 @@ interface SAMLConditions {
872
902
  * @throws {APIError} If timestamps are invalid, expired, or not yet valid
873
903
  */
874
904
  declare function validateSAMLTimestamp(conditions: SAMLConditions | undefined, options?: TimestampValidationOptions): void;
875
- declare const spMetadata: () => better_call0.StrictEndpoint<"/sso/saml2/sp/metadata", {
905
+ declare const spMetadata: (options?: SSOOptions) => better_call0.StrictEndpoint<"/sso/saml2/sp/metadata", {
876
906
  method: "GET";
877
907
  query: z.ZodObject<{
878
908
  providerId: z.ZodString;
@@ -1274,7 +1304,7 @@ declare const callbackSSO: (options?: SSOOptions) => better_call0.StrictEndpoint
1274
1304
  error: z.ZodOptional<z.ZodString>;
1275
1305
  error_description: z.ZodOptional<z.ZodString>;
1276
1306
  }, z.core.$strip>;
1277
- allowedMediaTypes: string[];
1307
+ allowedMediaTypes: readonly ["application/x-www-form-urlencoded", "application/json"];
1278
1308
  metadata: {
1279
1309
  openapi: {
1280
1310
  operationId: string;
@@ -1288,7 +1318,35 @@ declare const callbackSSO: (options?: SSOOptions) => better_call0.StrictEndpoint
1288
1318
  };
1289
1319
  scope: "server";
1290
1320
  };
1291
- }, never>;
1321
+ }, void>;
1322
+ /**
1323
+ * Shared OIDC callback endpoint (no `:providerId` in path).
1324
+ * Used when `options.redirectURI` is set — the `providerId` is read from
1325
+ * the OAuth state instead of the URL path.
1326
+ */
1327
+ declare const callbackSSOShared: (options?: SSOOptions) => better_call0.StrictEndpoint<"/sso/callback", {
1328
+ metadata: {
1329
+ openapi: {
1330
+ operationId: string;
1331
+ summary: string;
1332
+ description: string;
1333
+ responses: {
1334
+ "302": {
1335
+ description: string;
1336
+ };
1337
+ };
1338
+ };
1339
+ scope: "server";
1340
+ };
1341
+ method: "GET";
1342
+ query: z.ZodObject<{
1343
+ code: z.ZodOptional<z.ZodString>;
1344
+ state: z.ZodString;
1345
+ error: z.ZodOptional<z.ZodString>;
1346
+ error_description: z.ZodOptional<z.ZodString>;
1347
+ }, z.core.$strip>;
1348
+ allowedMediaTypes: readonly ["application/x-www-form-urlencoded", "application/json"];
1349
+ }, void>;
1292
1350
  declare const callbackSSOSAML: (options?: SSOOptions) => better_call0.StrictEndpoint<"/sso/saml2/callback/:providerId", {
1293
1351
  method: ("POST" | "GET")[];
1294
1352
  body: z.ZodOptional<z.ZodObject<{
@@ -1340,6 +1398,59 @@ declare const acsEndpoint: (options?: SSOOptions) => better_call0.StrictEndpoint
1340
1398
  scope: "server";
1341
1399
  };
1342
1400
  }, never>;
1401
+ declare const sloEndpoint: (options?: SSOOptions) => better_call0.StrictEndpoint<"/sso/saml2/sp/slo/:providerId", {
1402
+ method: ("POST" | "GET")[];
1403
+ body: z.ZodOptional<z.ZodObject<{
1404
+ SAMLRequest: z.ZodOptional<z.ZodString>;
1405
+ SAMLResponse: z.ZodOptional<z.ZodString>;
1406
+ RelayState: z.ZodOptional<z.ZodString>;
1407
+ SigAlg: z.ZodOptional<z.ZodString>;
1408
+ Signature: z.ZodOptional<z.ZodString>;
1409
+ }, z.core.$strip>>;
1410
+ query: z.ZodOptional<z.ZodObject<{
1411
+ SAMLRequest: z.ZodOptional<z.ZodString>;
1412
+ SAMLResponse: z.ZodOptional<z.ZodString>;
1413
+ RelayState: z.ZodOptional<z.ZodString>;
1414
+ SigAlg: z.ZodOptional<z.ZodString>;
1415
+ Signature: z.ZodOptional<z.ZodString>;
1416
+ }, z.core.$strip>>;
1417
+ metadata: {
1418
+ allowedMediaTypes: string[];
1419
+ scope: "server";
1420
+ };
1421
+ }, void | Response>;
1422
+ declare const initiateSLO: (options?: SSOOptions) => better_call0.StrictEndpoint<"/sso/saml2/logout/:providerId", {
1423
+ method: "POST";
1424
+ body: z.ZodObject<{
1425
+ callbackURL: z.ZodOptional<z.ZodString>;
1426
+ }, z.core.$strip>;
1427
+ use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
1428
+ session: {
1429
+ session: Record<string, any> & {
1430
+ id: string;
1431
+ createdAt: Date;
1432
+ updatedAt: Date;
1433
+ userId: string;
1434
+ expiresAt: Date;
1435
+ token: string;
1436
+ ipAddress?: string | null | undefined;
1437
+ userAgent?: string | null | undefined;
1438
+ };
1439
+ user: Record<string, any> & {
1440
+ id: string;
1441
+ createdAt: Date;
1442
+ updatedAt: Date;
1443
+ email: string;
1444
+ emailVerified: boolean;
1445
+ name: string;
1446
+ image?: string | null | undefined;
1447
+ };
1448
+ };
1449
+ }>)[];
1450
+ metadata: {
1451
+ readonly scope: "server";
1452
+ };
1453
+ }, never>;
1343
1454
  //#endregion
1344
1455
  //#region src/constants.d.ts
1345
1456
  /**
@@ -1612,52 +1723,5 @@ declare function selectTokenEndpointAuthMethod(doc: OIDCDiscoveryDocument, exist
1612
1723
  */
1613
1724
  declare function needsRuntimeDiscovery(config: Partial<HydratedOIDCConfig> | undefined): boolean;
1614
1725
  //#endregion
1615
- //#region src/index.d.ts
1616
- declare module "@better-auth/core" {
1617
- interface BetterAuthPluginRegistry<AuthOptions, Options> {
1618
- sso: {
1619
- creator: typeof sso;
1620
- };
1621
- }
1622
- }
1623
- type DomainVerificationEndpoints = {
1624
- requestDomainVerification: ReturnType<typeof requestDomainVerification>;
1625
- verifyDomain: ReturnType<typeof verifyDomain>;
1626
- };
1627
- type SSOEndpoints<O extends SSOOptions> = {
1628
- spMetadata: ReturnType<typeof spMetadata>;
1629
- registerSSOProvider: ReturnType<typeof registerSSOProvider<O>>;
1630
- signInSSO: ReturnType<typeof signInSSO>;
1631
- callbackSSO: ReturnType<typeof callbackSSO>;
1632
- callbackSSOSAML: ReturnType<typeof callbackSSOSAML>;
1633
- acsEndpoint: ReturnType<typeof acsEndpoint>;
1634
- listSSOProviders: ReturnType<typeof listSSOProviders>;
1635
- getSSOProvider: ReturnType<typeof getSSOProvider>;
1636
- updateSSOProvider: ReturnType<typeof updateSSOProvider>;
1637
- deleteSSOProvider: ReturnType<typeof deleteSSOProvider>;
1638
- };
1639
- type SSOPlugin<O extends SSOOptions> = {
1640
- id: "sso";
1641
- endpoints: SSOEndpoints<O> & (O extends {
1642
- domainVerification: {
1643
- enabled: true;
1644
- };
1645
- } ? DomainVerificationEndpoints : {});
1646
- };
1647
- declare function sso<O extends SSOOptions & {
1648
- domainVerification?: {
1649
- enabled: true;
1650
- };
1651
- }>(options?: O | undefined): {
1652
- id: "sso";
1653
- endpoints: SSOEndpoints<O> & DomainVerificationEndpoints;
1654
- schema: NonNullable<BetterAuthPlugin["schema"]>;
1655
- options: O;
1656
- };
1657
- declare function sso<O extends SSOOptions>(options?: O | undefined): {
1658
- id: "sso";
1659
- endpoints: SSOEndpoints<O>;
1660
- };
1661
- //#endregion
1662
- export { DataEncryptionAlgorithm as A, TimestampValidationOptions as C, SSOOptions as D, SAMLConfig as E, DigestAlgorithm as M, KeyEncryptionAlgorithm as N, SSOProvider as O, SignatureAlgorithm as P, SAMLConditions as S, OIDCConfig as T, REQUIRED_DISCOVERY_FIELDS as _, fetchDiscoveryDocument as a, DEFAULT_MAX_SAML_METADATA_SIZE as b, normalizeUrl as c, validateDiscoveryUrl as d, DiscoverOIDCConfigParams as f, OIDCDiscoveryDocument as g, HydratedOIDCConfig as h, discoverOIDCConfig as i, DeprecatedAlgorithmBehavior as j, AlgorithmValidationOptions as k, selectTokenEndpointAuthMethod as l, DiscoveryErrorCode as m, sso as n, needsRuntimeDiscovery as o, DiscoveryError as p, computeDiscoveryUrl as r, normalizeDiscoveryUrls as s, SSOPlugin as t, validateDiscoveryDocument as u, RequiredDiscoveryField as v, validateSAMLTimestamp as w, DEFAULT_MAX_SAML_RESPONSE_SIZE as x, DEFAULT_CLOCK_SKEW_MS as y };
1663
- //# sourceMappingURL=index-DCUy0gtM.d.mts.map
1726
+ export { spMetadata as A, SSOOptions as B, callbackSSO as C, registerSSOProvider as D, initiateSLO as E, updateSSOProvider as F, DigestAlgorithm as G, AlgorithmValidationOptions as H, requestDomainVerification as I, KeyEncryptionAlgorithm as K, verifyDomain as L, deleteSSOProvider as M, getSSOProvider as N, signInSSO as O, listSSOProviders as P, OIDCConfig as R, acsEndpoint as S, callbackSSOShared as T, DataEncryptionAlgorithm as U, SSOProvider as V, DeprecatedAlgorithmBehavior as W, DEFAULT_CLOCK_SKEW_MS as _, normalizeDiscoveryUrls as a, SAMLConditions as b, validateDiscoveryDocument as c, DiscoveryError as d, DiscoveryErrorCode as f, RequiredDiscoveryField as g, REQUIRED_DISCOVERY_FIELDS as h, needsRuntimeDiscovery as i, validateSAMLTimestamp as j, sloEndpoint as k, validateDiscoveryUrl as l, OIDCDiscoveryDocument as m, discoverOIDCConfig as n, normalizeUrl as o, HydratedOIDCConfig as p, SignatureAlgorithm as q, fetchDiscoveryDocument as r, selectTokenEndpointAuthMethod as s, computeDiscoveryUrl as t, DiscoverOIDCConfigParams as u, DEFAULT_MAX_SAML_METADATA_SIZE as v, callbackSSOSAML as w, TimestampValidationOptions as x, DEFAULT_MAX_SAML_RESPONSE_SIZE as y, SAMLConfig as z };
1727
+ //# sourceMappingURL=index-CbKvQr9M.d.mts.map
package/dist/index.d.mts CHANGED
@@ -1,2 +1,56 @@
1
- import { A as DataEncryptionAlgorithm, C as TimestampValidationOptions, D as SSOOptions, E as SAMLConfig, M as DigestAlgorithm, N as KeyEncryptionAlgorithm, O as SSOProvider, P as SignatureAlgorithm, S as SAMLConditions, T as OIDCConfig, _ as REQUIRED_DISCOVERY_FIELDS, a as fetchDiscoveryDocument, b as DEFAULT_MAX_SAML_METADATA_SIZE, c as normalizeUrl, d as validateDiscoveryUrl, f as DiscoverOIDCConfigParams, g as OIDCDiscoveryDocument, h as HydratedOIDCConfig, i as discoverOIDCConfig, j as DeprecatedAlgorithmBehavior, k as AlgorithmValidationOptions, l as selectTokenEndpointAuthMethod, m as DiscoveryErrorCode, n as sso, o as needsRuntimeDiscovery, p as DiscoveryError, r as computeDiscoveryUrl, s as normalizeDiscoveryUrls, t as SSOPlugin, u as validateDiscoveryDocument, v as RequiredDiscoveryField, w as validateSAMLTimestamp, x as DEFAULT_MAX_SAML_RESPONSE_SIZE, y as DEFAULT_CLOCK_SKEW_MS } from "./index-DCUy0gtM.mjs";
2
- export { AlgorithmValidationOptions, DEFAULT_CLOCK_SKEW_MS, DEFAULT_MAX_SAML_METADATA_SIZE, DEFAULT_MAX_SAML_RESPONSE_SIZE, DataEncryptionAlgorithm, DeprecatedAlgorithmBehavior, DigestAlgorithm, DiscoverOIDCConfigParams, DiscoveryError, DiscoveryErrorCode, HydratedOIDCConfig, KeyEncryptionAlgorithm, OIDCConfig, OIDCDiscoveryDocument, REQUIRED_DISCOVERY_FIELDS, RequiredDiscoveryField, SAMLConditions, SAMLConfig, SSOOptions, SSOPlugin, SSOProvider, SignatureAlgorithm, TimestampValidationOptions, computeDiscoveryUrl, discoverOIDCConfig, fetchDiscoveryDocument, needsRuntimeDiscovery, normalizeDiscoveryUrls, normalizeUrl, selectTokenEndpointAuthMethod, sso, validateDiscoveryDocument, validateDiscoveryUrl, validateSAMLTimestamp };
1
+ import { A as spMetadata, B as SSOOptions, C as callbackSSO, D as registerSSOProvider, E as initiateSLO, F as updateSSOProvider, G as DigestAlgorithm, H as AlgorithmValidationOptions, I as requestDomainVerification, K as KeyEncryptionAlgorithm, L as verifyDomain, M as deleteSSOProvider, N as getSSOProvider, O as signInSSO, P as listSSOProviders, R as OIDCConfig, S as acsEndpoint, T as callbackSSOShared, U as DataEncryptionAlgorithm, V as SSOProvider, W as DeprecatedAlgorithmBehavior, _ as DEFAULT_CLOCK_SKEW_MS, a as normalizeDiscoveryUrls, b as SAMLConditions, c as validateDiscoveryDocument, d as DiscoveryError, f as DiscoveryErrorCode, g as RequiredDiscoveryField, h as REQUIRED_DISCOVERY_FIELDS, i as needsRuntimeDiscovery, j as validateSAMLTimestamp, k as sloEndpoint, l as validateDiscoveryUrl, m as OIDCDiscoveryDocument, n as discoverOIDCConfig, o as normalizeUrl, p as HydratedOIDCConfig, q as SignatureAlgorithm, r as fetchDiscoveryDocument, s as selectTokenEndpointAuthMethod, t as computeDiscoveryUrl, u as DiscoverOIDCConfigParams, v as DEFAULT_MAX_SAML_METADATA_SIZE, w as callbackSSOSAML, x as TimestampValidationOptions, y as DEFAULT_MAX_SAML_RESPONSE_SIZE, z as SAMLConfig } from "./index-CbKvQr9M.mjs";
2
+ import { BetterAuthPlugin } from "better-auth";
3
+
4
+ //#region src/index.d.ts
5
+ declare module "@better-auth/core" {
6
+ interface BetterAuthPluginRegistry<AuthOptions, Options> {
7
+ sso: {
8
+ creator: typeof sso;
9
+ };
10
+ }
11
+ }
12
+ type DomainVerificationEndpoints = {
13
+ requestDomainVerification: ReturnType<typeof requestDomainVerification>;
14
+ verifyDomain: ReturnType<typeof verifyDomain>;
15
+ };
16
+ type SSOEndpoints<O extends SSOOptions> = {
17
+ spMetadata: ReturnType<typeof spMetadata>;
18
+ registerSSOProvider: ReturnType<typeof registerSSOProvider<O>>;
19
+ signInSSO: ReturnType<typeof signInSSO>;
20
+ callbackSSO: ReturnType<typeof callbackSSO>;
21
+ callbackSSOShared: ReturnType<typeof callbackSSOShared>;
22
+ callbackSSOSAML: ReturnType<typeof callbackSSOSAML>;
23
+ acsEndpoint: ReturnType<typeof acsEndpoint>;
24
+ sloEndpoint: ReturnType<typeof sloEndpoint>;
25
+ initiateSLO: ReturnType<typeof initiateSLO>;
26
+ listSSOProviders: ReturnType<typeof listSSOProviders>;
27
+ getSSOProvider: ReturnType<typeof getSSOProvider>;
28
+ updateSSOProvider: ReturnType<typeof updateSSOProvider>;
29
+ deleteSSOProvider: ReturnType<typeof deleteSSOProvider>;
30
+ };
31
+ type SSOPlugin<O extends SSOOptions> = {
32
+ id: "sso";
33
+ endpoints: SSOEndpoints<O> & (O extends {
34
+ domainVerification: {
35
+ enabled: true;
36
+ };
37
+ } ? DomainVerificationEndpoints : {});
38
+ };
39
+ declare function sso<O extends SSOOptions & {
40
+ domainVerification?: {
41
+ enabled: true;
42
+ };
43
+ }>(options?: O | undefined): {
44
+ id: "sso";
45
+ endpoints: SSOEndpoints<O> & DomainVerificationEndpoints;
46
+ schema: NonNullable<BetterAuthPlugin["schema"]>;
47
+ options: O;
48
+ };
49
+ declare function sso<O extends SSOOptions>(options?: O | undefined): {
50
+ id: "sso";
51
+ endpoints: SSOEndpoints<O>;
52
+ options: O;
53
+ };
54
+ //#endregion
55
+ export { type AlgorithmValidationOptions, DEFAULT_CLOCK_SKEW_MS, DEFAULT_MAX_SAML_METADATA_SIZE, DEFAULT_MAX_SAML_RESPONSE_SIZE, DataEncryptionAlgorithm, type DeprecatedAlgorithmBehavior, DigestAlgorithm, type DiscoverOIDCConfigParams, DiscoveryError, type DiscoveryErrorCode, type HydratedOIDCConfig, KeyEncryptionAlgorithm, type OIDCConfig, type OIDCDiscoveryDocument, REQUIRED_DISCOVERY_FIELDS, type RequiredDiscoveryField, type SAMLConditions, type SAMLConfig, type SSOOptions, SSOPlugin, type SSOProvider, SignatureAlgorithm, type TimestampValidationOptions, computeDiscoveryUrl, discoverOIDCConfig, fetchDiscoveryDocument, needsRuntimeDiscovery, normalizeDiscoveryUrls, normalizeUrl, selectTokenEndpointAuthMethod, sso, validateDiscoveryDocument, validateDiscoveryUrl, validateSAMLTimestamp };
56
+ //# sourceMappingURL=index.d.mts.map