@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.
- package/.turbo/turbo-build.log +11 -11
- package/dist/client.d.mts +3 -2
- package/dist/client.mjs +1 -1
- package/dist/client.mjs.map +1 -1
- package/dist/{index-DCUy0gtM.d.mts → index-CbKvQr9M.d.mts} +129 -65
- package/dist/index.d.mts +56 -2
- package/dist/index.mjs +637 -238
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
- package/src/client.ts +1 -1
- package/src/constants.ts +21 -0
- package/src/domain-verification.test.ts +46 -5
- package/src/index.ts +43 -2
- package/src/oidc/discovery.test.ts +7 -12
- package/src/oidc.test.ts +302 -1
- package/src/providers.test.ts +39 -45
- package/src/routes/domain-verification.ts +34 -12
- package/src/routes/helpers.ts +126 -0
- package/src/routes/providers.ts +16 -14
- package/src/routes/sso.ts +932 -365
- package/src/saml/algorithms.test.ts +1 -9
- package/src/saml/error-codes.ts +11 -0
- package/src/saml.test.ts +736 -4
- package/src/types.ts +53 -2
- package/src/utils.test.ts +3 -0
- package/vitest.config.ts +6 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
|
|
2
|
-
> @better-auth/sso@1.5.0-beta.
|
|
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
|
-
[34mℹ[39m tsdown [2mv0.20.
|
|
5
|
+
[34mℹ[39m tsdown [2mv0.20.3[22m powered by rolldown [2mv1.0.0-rc.3[22m
|
|
6
6
|
[34mℹ[39m config file: [4m/home/runner/work/better-auth/better-auth/packages/sso/tsdown.config.ts[24m
|
|
7
7
|
[34mℹ[39m entry: [34msrc/index.ts, src/client.ts[39m
|
|
8
8
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
9
|
[34mℹ[39m Build start
|
|
10
|
-
[34mℹ[39m [2mdist/[22m[1mindex.mjs[22m [
|
|
11
|
-
[34mℹ[39m [2mdist/[22m[1mclient.mjs[22m [2m 0.
|
|
12
|
-
[34mℹ[39m [2mdist/[22mindex.mjs.map [
|
|
13
|
-
[34mℹ[39m [2mdist/[22mclient.mjs.map [2m 0.
|
|
14
|
-
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.mts[22m[39m [2m
|
|
15
|
-
[34mℹ[39m [2mdist/[22m[32m[1mclient.d.mts[22m[39m [2m 0.
|
|
16
|
-
[34mℹ[39m [2mdist/[22m[32mindex-
|
|
17
|
-
[34mℹ[39m 7 files, total:
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1mindex.mjs[22m [2m139.98 kB[22m [2m│ gzip: 27.81 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mclient.mjs[22m [2m 0.27 kB[22m [2m│ gzip: 0.21 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22mindex.mjs.map [2m280.86 kB[22m [2m│ gzip: 53.94 kB[22m
|
|
13
|
+
[34mℹ[39m [2mdist/[22mclient.mjs.map [2m 0.93 kB[22m [2m│ gzip: 0.50 kB[22m
|
|
14
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.mts[22m[39m [2m 3.79 kB[22m [2m│ gzip: 1.20 kB[22m
|
|
15
|
+
[34mℹ[39m [2mdist/[22m[32m[1mclient.d.mts[22m[39m [2m 0.63 kB[22m [2m│ gzip: 0.36 kB[22m
|
|
16
|
+
[34mℹ[39m [2mdist/[22m[32mindex-CbKvQr9M.d.mts[39m [2m 58.40 kB[22m [2m│ gzip: 10.28 kB[22m
|
|
17
|
+
[34mℹ[39m 7 files, total: 484.85 kB
|
|
18
18
|
[33m[PLUGIN_TIMINGS] Warning:[0m Your build spent significant time in plugin `rolldown-plugin-dts:generate`. See https://rolldown.rs/options/checks#plugintimings for more details.
|
|
19
19
|
|
|
20
|
-
[32m✔[39m Build complete in [
|
|
20
|
+
[32m✔[39m Build complete in [32m31855ms[39m
|
package/dist/client.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
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/
|
|
21
|
+
"/sso/get-provider": "GET";
|
|
21
22
|
};
|
|
22
23
|
};
|
|
23
24
|
//#endregion
|
package/dist/client.mjs
CHANGED
package/dist/client.mjs.map
CHANGED
|
@@ -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/
|
|
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,
|
|
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/
|
|
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
|
-
|
|
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/
|
|
648
|
-
method: "
|
|
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/
|
|
807
|
-
method: "
|
|
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
|
-
|
|
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:
|
|
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
|
-
},
|
|
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
|
-
|
|
1616
|
-
|
|
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
|
|
2
|
-
|
|
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
|