@better-auth/oauth-provider 1.7.9 → 1.8.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/{authorize-D8r6mvZx.mjs → authorize-92EtLsBi.mjs} +735 -502
- package/dist/client-resource.d.mts +1 -1
- package/dist/client-resource.mjs +2 -2
- package/dist/client.d.mts +1 -1
- package/dist/client.mjs +1 -1
- package/dist/index-sGnh4IfY.d.mts +275 -0
- package/dist/index.d.mts +4 -203
- package/dist/index.mjs +198 -41
- package/dist/internal.d.mts +108 -40
- package/dist/internal.mjs +4 -2
- package/dist/{introspect-7WCMPe5Z.mjs → introspect-CEo9Q06v.mjs} +318 -237
- package/dist/{oauth-DAMtT2vg.d.mts → oauth-BlEuA8oD.d.mts} +380 -20
- package/dist/{oauth-BWgg8X-A.d.mts → oauth-mdkaIwmm.d.mts} +191 -86
- package/dist/{utils-DKU5wblX.mjs → utils-BMNe8Sg2.mjs} +343 -5
- package/dist/{version-DVUrz-nv.mjs → version-DeABnmP9.mjs} +1 -1
- package/package.json +6 -6
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as OAuthClientRegistrationResponse, F as OAuthMetadataExtensionInput, J as Scope, K as Prompt, L as OAuthOptions, P as OAuthInteractionRequestHandler, V as OAuthResource, W as OAuthTokenResponse, a as GrantType, j as OAuthExtensionGrantHandlerInput, k as OAuthConsent, l as TokenEndpointAuthMethod, n as AuthServerMetadata, o as OAuthClient, tt as clientRegistrationRequestSchema, u as TokenType, x as OAuthClientAdministrativeResponse } from "./oauth-BlEuA8oD.mjs";
|
|
2
2
|
import * as _$better_call0 from "better-call";
|
|
3
|
+
import { EndpointContext, EndpointOptions, StrictEndpoint } from "better-call";
|
|
3
4
|
import * as z from "zod";
|
|
4
|
-
import * as _$jose from "jose";
|
|
5
5
|
import * as _$better_auth_plugins0 from "better-auth/plugins";
|
|
6
|
+
import * as _$jose from "jose";
|
|
7
|
+
import { JSONWebKeySet } from "jose";
|
|
6
8
|
import { DeviceAuthorizationGrant, DeviceAuthorizationPluginOptions } from "better-auth/plugins/device-authorization";
|
|
7
9
|
import { AuthContext, GenericEndpointContext } from "@better-auth/core";
|
|
8
10
|
import * as _$better_auth0 from "better-auth";
|
|
@@ -23,7 +25,7 @@ declare const DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_
|
|
|
23
25
|
* polling and atomic-consumption state machine for this handler.
|
|
24
26
|
*/
|
|
25
27
|
declare function exchangeOAuthDeviceCode(input: OAuthExtensionGrantHandlerInput): Promise<OAuthTokenResponse>;
|
|
26
|
-
declare function buildOAuthDeviceGrant(): {
|
|
28
|
+
declare function buildOAuthDeviceGrant(verificationUri: string | undefined): {
|
|
27
29
|
requestSchemaFields: {
|
|
28
30
|
client_secret: z.ZodOptional<z.ZodString>;
|
|
29
31
|
client_assertion: z.ZodOptional<z.ZodString>;
|
|
@@ -72,6 +74,22 @@ declare function buildOAuthDeviceGrant(): {
|
|
|
72
74
|
type: "string";
|
|
73
75
|
required: false;
|
|
74
76
|
};
|
|
77
|
+
referenceId: {
|
|
78
|
+
type: "string";
|
|
79
|
+
required: false;
|
|
80
|
+
};
|
|
81
|
+
authTime: {
|
|
82
|
+
type: "date";
|
|
83
|
+
required: false;
|
|
84
|
+
};
|
|
85
|
+
acr: {
|
|
86
|
+
type: "string";
|
|
87
|
+
required: false;
|
|
88
|
+
};
|
|
89
|
+
amr: {
|
|
90
|
+
type: "string[]";
|
|
91
|
+
required: false;
|
|
92
|
+
};
|
|
75
93
|
};
|
|
76
94
|
grants: {
|
|
77
95
|
"urn:ietf:params:oauth:grant-type:device_code": typeof exchangeOAuthDeviceCode;
|
|
@@ -83,7 +101,7 @@ declare function buildOAuthDeviceGrant(): {
|
|
|
83
101
|
ctx,
|
|
84
102
|
request
|
|
85
103
|
}: {
|
|
86
|
-
ctx:
|
|
104
|
+
ctx: GenericEndpointContext;
|
|
87
105
|
request: _$better_auth_plugins0.DeviceAuthorizationRequest & {
|
|
88
106
|
client_secret?: string | undefined;
|
|
89
107
|
client_assertion?: string | undefined;
|
|
@@ -97,28 +115,16 @@ declare function buildOAuthDeviceGrant(): {
|
|
|
97
115
|
resources: string[] | null;
|
|
98
116
|
};
|
|
99
117
|
} | undefined>;
|
|
100
|
-
|
|
101
|
-
deviceCode
|
|
118
|
+
assertStandaloneUse: ({
|
|
119
|
+
deviceCode,
|
|
120
|
+
use
|
|
102
121
|
}: {
|
|
103
|
-
ctx:
|
|
122
|
+
ctx: GenericEndpointContext;
|
|
104
123
|
deviceCode: Record<string, unknown>;
|
|
124
|
+
use: "redeem" | "approve";
|
|
105
125
|
}) => void;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
} | undefined;
|
|
109
|
-
verificationOpenAPIProperties: {
|
|
110
|
-
resource: {
|
|
111
|
-
oneOf: ({
|
|
112
|
-
type: string;
|
|
113
|
-
items?: undefined;
|
|
114
|
-
} | {
|
|
115
|
-
type: string;
|
|
116
|
-
items: {
|
|
117
|
-
type: string;
|
|
118
|
-
};
|
|
119
|
-
})[];
|
|
120
|
-
description: string;
|
|
121
|
-
};
|
|
126
|
+
interactionRequests: {
|
|
127
|
+
user_code: OAuthInteractionRequestHandler;
|
|
122
128
|
};
|
|
123
129
|
};
|
|
124
130
|
type OAuthDeviceGrant = ReturnType<typeof buildOAuthDeviceGrant>;
|
|
@@ -335,10 +341,10 @@ declare function oauthDeviceAuthorization(options?: OAuthDeviceAuthorizationOpti
|
|
|
335
341
|
error: z.ZodObject<{
|
|
336
342
|
error: z.ZodEnum<{
|
|
337
343
|
invalid_request: "invalid_request";
|
|
338
|
-
authorization_pending: "authorization_pending";
|
|
339
|
-
slow_down: "slow_down";
|
|
340
344
|
expired_token: "expired_token";
|
|
341
345
|
access_denied: "access_denied";
|
|
346
|
+
authorization_pending: "authorization_pending";
|
|
347
|
+
slow_down: "slow_down";
|
|
342
348
|
invalid_grant: "invalid_grant";
|
|
343
349
|
}>;
|
|
344
350
|
error_description: z.ZodString;
|
|
@@ -442,13 +448,11 @@ declare function oauthDeviceAuthorization(options?: OAuthDeviceAuthorizationOpti
|
|
|
442
448
|
};
|
|
443
449
|
};
|
|
444
450
|
}, {
|
|
445
|
-
user_code: string;
|
|
446
|
-
status: string;
|
|
447
451
|
client_id?: string | undefined;
|
|
448
452
|
scope?: string | undefined;
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
}
|
|
453
|
+
user_code: string;
|
|
454
|
+
status: string;
|
|
455
|
+
}>;
|
|
452
456
|
deviceApprove: _$better_call0.StrictEndpoint<"/device/approve", {
|
|
453
457
|
method: "POST";
|
|
454
458
|
body: z.ZodObject<{
|
|
@@ -459,7 +463,6 @@ declare function oauthDeviceAuthorization(options?: OAuthDeviceAuthorizationOpti
|
|
|
459
463
|
invalid_request: "invalid_request";
|
|
460
464
|
expired_token: "expired_token";
|
|
461
465
|
access_denied: "access_denied";
|
|
462
|
-
device_code_already_processed: "device_code_already_processed";
|
|
463
466
|
unauthorized: "unauthorized";
|
|
464
467
|
}>;
|
|
465
468
|
error_description: z.ZodString;
|
|
@@ -554,7 +557,7 @@ declare function oauthDeviceAuthorization(options?: OAuthDeviceAuthorizationOpti
|
|
|
554
557
|
options: {
|
|
555
558
|
grant: DeviceAuthorizationGrant<Readonly<{
|
|
556
559
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
557
|
-
}
|
|
560
|
+
}>> | undefined;
|
|
558
561
|
expiresIn: _$better_auth_plugins0.TimeString;
|
|
559
562
|
interval: _$better_auth_plugins0.TimeString;
|
|
560
563
|
deviceCodeLength: number;
|
|
@@ -612,6 +615,63 @@ interface OAuthEndpointRedirectContext<Ctx = unknown> {
|
|
|
612
615
|
ctx: Ctx;
|
|
613
616
|
}
|
|
614
617
|
type OAuthRedirectOnError<Ctx = unknown, Result = unknown> = (result: OAuthEndpointRedirectContext<Ctx>) => Result | Promise<Result>;
|
|
618
|
+
type ValidationErrorHookArgs = {
|
|
619
|
+
message: string;
|
|
620
|
+
issues: readonly z.core.$ZodIssue[];
|
|
621
|
+
};
|
|
622
|
+
type ValidationErrorHook = (args: ValidationErrorHookArgs) => unknown;
|
|
623
|
+
interface OAuthEndpointExtras<Ctx = EndpointContext<string, EndpointOptions, AuthContext>> {
|
|
624
|
+
/**
|
|
625
|
+
* Invoked when validation fails. Presence switches delivery from a JSON
|
|
626
|
+
* `APIError` envelope to this callback, which receives the request
|
|
627
|
+
* context so it can compute an RP redirect URL from already-parsed query
|
|
628
|
+
* params.
|
|
629
|
+
*/
|
|
630
|
+
redirectOnError?: OAuthRedirectOnError<Ctx>;
|
|
631
|
+
/**
|
|
632
|
+
* Forwarded to `better-call` and awaited before the RFC envelope is
|
|
633
|
+
* synthesized, so callers can observe or transform issues.
|
|
634
|
+
*/
|
|
635
|
+
onValidationError?: ValidationErrorHook;
|
|
636
|
+
/**
|
|
637
|
+
* First-path-segment → RFC code mapping. Nested failures like
|
|
638
|
+
* `jwks.keys[0].n` collapse to `jwks`; lift a nested schema to a
|
|
639
|
+
* top-level field when per-sub-field codes are required.
|
|
640
|
+
*/
|
|
641
|
+
errorCodesByField?: Record<string, OAuthFieldErrorCode>;
|
|
642
|
+
/**
|
|
643
|
+
* RFC code returned when no `errorCodesByField` entry matches or the failure is
|
|
644
|
+
* structurally malformed (wrong type, duplicated params, bad format).
|
|
645
|
+
* @default "invalid_request"
|
|
646
|
+
*/
|
|
647
|
+
defaultError?: OAuthErrorCode;
|
|
648
|
+
/**
|
|
649
|
+
* Re-reads the raw form before validation, because the form parser keeps
|
|
650
|
+
* only the last value of a repeated key. Empty values count as omitted and
|
|
651
|
+
* repeated parameters return `invalid_request` (RFC 6749 §3.2), except the
|
|
652
|
+
* names in `repeatable`, which become arrays. Enables `cloneRequest`.
|
|
653
|
+
*/
|
|
654
|
+
formParams?: {
|
|
655
|
+
repeatable?: readonly string[];
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* Wraps `createAuthEndpoint` so zod schemas stay the single source of truth
|
|
660
|
+
* for body/query shape while validation failures serialize as the RFC 6749
|
|
661
|
+
* §5.2 error envelope `{ error, error_description }`.
|
|
662
|
+
*
|
|
663
|
+
* A failing issue is routed by its first path segment via `errorCodesByField`:
|
|
664
|
+
* - missing required (`invalid_type` + "received undefined") → `.missing`
|
|
665
|
+
* - unsupported value (`invalid_value`) or a value a refinement rejected
|
|
666
|
+
* (`custom`, also inside a union branch) → `.invalid`
|
|
667
|
+
* - anything else (wrong type, duplicated params, bad format) → `defaultError`
|
|
668
|
+
*
|
|
669
|
+
* For enum fields that need to distinguish missing from unsupported, compose
|
|
670
|
+
* as `z.string().pipe(z.enum([...]))` so duplicated params fail the outer
|
|
671
|
+
* `z.string()` as `invalid_type` instead of masquerading as an unsupported
|
|
672
|
+
* enum value.
|
|
673
|
+
*/
|
|
674
|
+
declare function createOAuthEndpoint<Path extends string, Options extends EndpointOptions, R>(path: Path, options: Options & OAuthEndpointExtras<EndpointContext<Path, Options, AuthContext>>, handler: (ctx: EndpointContext<Path, Options, AuthContext>) => Promise<R>): StrictEndpoint<Path, Options, R>;
|
|
615
675
|
//#endregion
|
|
616
676
|
//#region src/authorize.d.ts
|
|
617
677
|
type OAuthRedirectResult = {
|
|
@@ -623,6 +683,27 @@ type OAuthRedirectResult = {
|
|
|
623
683
|
*/
|
|
624
684
|
declare function getIssuer(ctx: GenericEndpointContext, opts: OAuthOptions<Scope[]>): string;
|
|
625
685
|
//#endregion
|
|
686
|
+
//#region src/client-jwks.d.ts
|
|
687
|
+
/** A client's inline public JWK Set, as registration and key rotation accept it. */
|
|
688
|
+
type ClientJwks = NonNullable<OAuthClient["jwks"]>;
|
|
689
|
+
type PublicClientJwksValidationResult = {
|
|
690
|
+
valid: true;
|
|
691
|
+
jwks: JSONWebKeySet;
|
|
692
|
+
} | {
|
|
693
|
+
valid: false;
|
|
694
|
+
error: "jwks must be an RFC 7517 JWK Set object with a non-empty keys array" | "jwks must contain only public asymmetric keys" | "jwks keys must be supported public JWKs with required key parameters" | "jwks key alg must be supported for private_key_jwt and compatible with its key type and signing curve";
|
|
695
|
+
};
|
|
696
|
+
/**
|
|
697
|
+
* Validates an OAuth client's public asymmetric JWK set.
|
|
698
|
+
*
|
|
699
|
+
* This boundary accepts only the RFC 7517 `{ keys: [...] }` representation.
|
|
700
|
+
* It performs no I/O and returns the validated set for downstream JOSE
|
|
701
|
+
* verification.
|
|
702
|
+
*
|
|
703
|
+
* @internal
|
|
704
|
+
*/
|
|
705
|
+
declare function validatePublicClientJwks(input: unknown): PublicClientJwksValidationResult;
|
|
706
|
+
//#endregion
|
|
626
707
|
//#region src/oauth.d.ts
|
|
627
708
|
/**
|
|
628
709
|
* Default scopes advertised and accepted when a configuration sets none. Shared
|
|
@@ -770,6 +851,8 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
770
851
|
backchannel_logout_supported?: boolean | undefined;
|
|
771
852
|
backchannel_logout_session_supported?: boolean | undefined;
|
|
772
853
|
dpop_signing_alg_values_supported?: _$better_auth_plugins0.JWSAlgorithms[] | undefined;
|
|
854
|
+
frontchannel_logout_supported?: boolean | undefined;
|
|
855
|
+
frontchannel_logout_session_supported?: boolean | undefined;
|
|
773
856
|
id_token_signing_alg_values_supported: _$better_auth_plugins0.JWSAlgorithms[] | ["HS256"];
|
|
774
857
|
}>;
|
|
775
858
|
oauth2Authorize: _$better_call0.StrictEndpoint<"/oauth2/authorize", {
|
|
@@ -791,17 +874,6 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
791
874
|
items?: undefined;
|
|
792
875
|
};
|
|
793
876
|
description: string;
|
|
794
|
-
} | {
|
|
795
|
-
name: string;
|
|
796
|
-
in: "query";
|
|
797
|
-
required: true;
|
|
798
|
-
schema: {
|
|
799
|
-
type: "string";
|
|
800
|
-
format?: undefined;
|
|
801
|
-
minimum?: undefined;
|
|
802
|
-
items?: undefined;
|
|
803
|
-
};
|
|
804
|
-
description: string;
|
|
805
877
|
} | {
|
|
806
878
|
name: string;
|
|
807
879
|
in: "query";
|
|
@@ -996,7 +1068,9 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
996
1068
|
}, OAuthRedirectResult>;
|
|
997
1069
|
oauth2Token: _$better_call0.StrictEndpoint<"/oauth2/token", {
|
|
998
1070
|
method: "POST";
|
|
999
|
-
|
|
1071
|
+
formParams: {
|
|
1072
|
+
repeatable: string[];
|
|
1073
|
+
};
|
|
1000
1074
|
body: z.ZodObject<{
|
|
1001
1075
|
grant_type: z.ZodString;
|
|
1002
1076
|
client_id: z.ZodOptional<z.ZodString>;
|
|
@@ -1168,7 +1242,7 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
1168
1242
|
}>;
|
|
1169
1243
|
oauth2Introspect: _$better_call0.StrictEndpoint<"/oauth2/introspect", {
|
|
1170
1244
|
method: "POST";
|
|
1171
|
-
|
|
1245
|
+
formParams: {};
|
|
1172
1246
|
body: z.ZodObject<{
|
|
1173
1247
|
client_id: z.ZodOptional<z.ZodString>;
|
|
1174
1248
|
client_secret: z.ZodOptional<z.ZodString>;
|
|
@@ -1301,7 +1375,7 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
1301
1375
|
}, _$jose.JWTPayload>;
|
|
1302
1376
|
oauth2Revoke: _$better_call0.StrictEndpoint<"/oauth2/revoke", {
|
|
1303
1377
|
method: "POST";
|
|
1304
|
-
|
|
1378
|
+
formParams: {};
|
|
1305
1379
|
body: z.ZodObject<{
|
|
1306
1380
|
client_id: z.ZodOptional<z.ZodString>;
|
|
1307
1381
|
client_secret: z.ZodOptional<z.ZodString>;
|
|
@@ -1380,7 +1454,7 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
1380
1454
|
};
|
|
1381
1455
|
};
|
|
1382
1456
|
};
|
|
1383
|
-
}, null
|
|
1457
|
+
}, null>;
|
|
1384
1458
|
oauth2UserInfo: _$better_call0.StrictEndpoint<"/oauth2/userinfo", {
|
|
1385
1459
|
method: ("GET" | "POST")[];
|
|
1386
1460
|
body: z.ZodOptional<z.ZodObject<{
|
|
@@ -1547,6 +1621,7 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
1547
1621
|
"text/html": {
|
|
1548
1622
|
schema: {
|
|
1549
1623
|
type: "string";
|
|
1624
|
+
description: string;
|
|
1550
1625
|
};
|
|
1551
1626
|
};
|
|
1552
1627
|
};
|
|
@@ -1568,42 +1643,7 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
1568
1643
|
}, Response | OAuthRedirectResult | null>;
|
|
1569
1644
|
registerOAuthClient: _$better_call0.StrictEndpoint<"/oauth2/register", {
|
|
1570
1645
|
method: "POST";
|
|
1571
|
-
body:
|
|
1572
|
-
redirect_uris: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
1573
|
-
scope: z.ZodOptional<z.ZodString>;
|
|
1574
|
-
client_name: z.ZodOptional<z.ZodString>;
|
|
1575
|
-
client_uri: z.ZodOptional<z.ZodString>;
|
|
1576
|
-
logo_uri: z.ZodOptional<z.ZodString>;
|
|
1577
|
-
contacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1578
|
-
tos_uri: z.ZodOptional<z.ZodString>;
|
|
1579
|
-
policy_uri: z.ZodOptional<z.ZodString>;
|
|
1580
|
-
software_id: z.ZodOptional<z.ZodString>;
|
|
1581
|
-
software_version: z.ZodOptional<z.ZodString>;
|
|
1582
|
-
software_statement: z.ZodOptional<z.ZodString>;
|
|
1583
|
-
post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
1584
|
-
backchannel_logout_uri: z.ZodOptional<z.ZodURL>;
|
|
1585
|
-
backchannel_logout_session_required: z.ZodOptional<z.ZodBoolean>;
|
|
1586
|
-
token_endpoint_auth_method: z.ZodOptional<z.ZodString>;
|
|
1587
|
-
jwks: z.ZodOptional<z.ZodObject<{
|
|
1588
|
-
keys: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1589
|
-
}, z.core.$strip>>;
|
|
1590
|
-
jwks_uri: z.ZodOptional<z.ZodString>;
|
|
1591
|
-
grant_types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1592
|
-
response_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1593
|
-
code: "code";
|
|
1594
|
-
}>>>;
|
|
1595
|
-
application_type: z.ZodOptional<z.ZodEnum<{
|
|
1596
|
-
web: "web";
|
|
1597
|
-
native: "native";
|
|
1598
|
-
}>>;
|
|
1599
|
-
subject_type: z.ZodOptional<z.ZodEnum<{
|
|
1600
|
-
public: "public";
|
|
1601
|
-
pairwise: "pairwise";
|
|
1602
|
-
}>>;
|
|
1603
|
-
dpop_bound_access_tokens: z.ZodOptional<z.ZodBoolean>;
|
|
1604
|
-
resources: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1605
|
-
skip_consent: z.ZodOptional<z.ZodNever>;
|
|
1606
|
-
}, z.core.$strip>;
|
|
1646
|
+
body: typeof clientRegistrationRequestSchema;
|
|
1607
1647
|
errorCodesByField: {
|
|
1608
1648
|
redirect_uris: "invalid_redirect_uri";
|
|
1609
1649
|
post_logout_redirect_uris: "invalid_redirect_uri";
|
|
@@ -1711,6 +1751,15 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
1711
1751
|
type: string;
|
|
1712
1752
|
description: string;
|
|
1713
1753
|
};
|
|
1754
|
+
frontchannel_logout_uri: {
|
|
1755
|
+
type: string;
|
|
1756
|
+
format: string;
|
|
1757
|
+
description: string;
|
|
1758
|
+
};
|
|
1759
|
+
frontchannel_logout_session_required: {
|
|
1760
|
+
type: string;
|
|
1761
|
+
description: string;
|
|
1762
|
+
};
|
|
1714
1763
|
token_endpoint_auth_method: {
|
|
1715
1764
|
type: string;
|
|
1716
1765
|
description: string;
|
|
@@ -1774,6 +1823,8 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
1774
1823
|
post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
1775
1824
|
backchannel_logout_uri: z.ZodOptional<z.ZodURL>;
|
|
1776
1825
|
backchannel_logout_session_required: z.ZodOptional<z.ZodBoolean>;
|
|
1826
|
+
frontchannel_logout_uri: z.ZodOptional<z.ZodURL>;
|
|
1827
|
+
frontchannel_logout_session_required: z.ZodOptional<z.ZodBoolean>;
|
|
1777
1828
|
token_endpoint_auth_method: z.ZodOptional<z.ZodString>;
|
|
1778
1829
|
application_type: z.ZodOptional<z.ZodEnum<{
|
|
1779
1830
|
web: "web";
|
|
@@ -1988,6 +2039,8 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
1988
2039
|
post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
1989
2040
|
backchannel_logout_uri: z.ZodOptional<z.ZodURL>;
|
|
1990
2041
|
backchannel_logout_session_required: z.ZodOptional<z.ZodBoolean>;
|
|
2042
|
+
frontchannel_logout_uri: z.ZodOptional<z.ZodURL>;
|
|
2043
|
+
frontchannel_logout_session_required: z.ZodOptional<z.ZodBoolean>;
|
|
1991
2044
|
token_endpoint_auth_method: z.ZodOptional<z.ZodString>;
|
|
1992
2045
|
application_type: z.ZodOptional<z.ZodEnum<{
|
|
1993
2046
|
web: "web";
|
|
@@ -2267,8 +2320,10 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
2267
2320
|
software_version: z.ZodOptional<z.ZodString>;
|
|
2268
2321
|
software_statement: z.ZodOptional<z.ZodString>;
|
|
2269
2322
|
post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
2270
|
-
backchannel_logout_uri: z.ZodOptional<z.ZodURL
|
|
2323
|
+
backchannel_logout_uri: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
2271
2324
|
backchannel_logout_session_required: z.ZodOptional<z.ZodBoolean>;
|
|
2325
|
+
frontchannel_logout_uri: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
2326
|
+
frontchannel_logout_session_required: z.ZodOptional<z.ZodBoolean>;
|
|
2272
2327
|
application_type: z.ZodOptional<z.ZodEnum<{
|
|
2273
2328
|
web: "web";
|
|
2274
2329
|
native: "native";
|
|
@@ -2333,8 +2388,10 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
2333
2388
|
software_version: z.ZodOptional<z.ZodString>;
|
|
2334
2389
|
software_statement: z.ZodOptional<z.ZodString>;
|
|
2335
2390
|
post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
2336
|
-
backchannel_logout_uri: z.ZodOptional<z.ZodURL
|
|
2391
|
+
backchannel_logout_uri: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
2337
2392
|
backchannel_logout_session_required: z.ZodOptional<z.ZodBoolean>;
|
|
2393
|
+
frontchannel_logout_uri: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
2394
|
+
frontchannel_logout_session_required: z.ZodOptional<z.ZodBoolean>;
|
|
2338
2395
|
application_type: z.ZodOptional<z.ZodEnum<{
|
|
2339
2396
|
web: "web";
|
|
2340
2397
|
native: "native";
|
|
@@ -2386,6 +2443,30 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
2386
2443
|
};
|
|
2387
2444
|
};
|
|
2388
2445
|
}, OAuthClient>;
|
|
2446
|
+
rotateClientKeys: _$better_call0.StrictEndpoint<"/oauth2/client/rotate-keys", {
|
|
2447
|
+
method: "POST";
|
|
2448
|
+
body: z.ZodObject<{
|
|
2449
|
+
client_assertion: z.ZodString;
|
|
2450
|
+
client_assertion_type: z.ZodString;
|
|
2451
|
+
jwks: z.ZodObject<{
|
|
2452
|
+
keys: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2453
|
+
}, z.core.$strip>;
|
|
2454
|
+
}, z.core.$strip>;
|
|
2455
|
+
errorCodesByField: {
|
|
2456
|
+
client_assertion: "invalid_client";
|
|
2457
|
+
client_assertion_type: "invalid_client";
|
|
2458
|
+
jwks: "invalid_client_metadata";
|
|
2459
|
+
};
|
|
2460
|
+
metadata: {
|
|
2461
|
+
noStore: boolean;
|
|
2462
|
+
openapi: {
|
|
2463
|
+
description: string;
|
|
2464
|
+
};
|
|
2465
|
+
};
|
|
2466
|
+
}, {
|
|
2467
|
+
client_id: string;
|
|
2468
|
+
jwks: ClientJwks;
|
|
2469
|
+
}>;
|
|
2389
2470
|
deleteOAuthClient: _$better_call0.StrictEndpoint<"/oauth2/delete-client", {
|
|
2390
2471
|
method: "POST";
|
|
2391
2472
|
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
@@ -2677,6 +2758,10 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
2677
2758
|
type: "string";
|
|
2678
2759
|
required: false;
|
|
2679
2760
|
};
|
|
2761
|
+
sectorIdentifier: {
|
|
2762
|
+
type: "string";
|
|
2763
|
+
required: false;
|
|
2764
|
+
};
|
|
2680
2765
|
scopes: {
|
|
2681
2766
|
type: "string[]";
|
|
2682
2767
|
required: false;
|
|
@@ -2755,6 +2840,14 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
2755
2840
|
type: "boolean";
|
|
2756
2841
|
required: false;
|
|
2757
2842
|
};
|
|
2843
|
+
frontchannelLogoutUri: {
|
|
2844
|
+
type: "string";
|
|
2845
|
+
required: false;
|
|
2846
|
+
};
|
|
2847
|
+
frontchannelLogoutSessionRequired: {
|
|
2848
|
+
type: "boolean";
|
|
2849
|
+
required: false;
|
|
2850
|
+
};
|
|
2758
2851
|
tokenEndpointAuthMethod: {
|
|
2759
2852
|
type: "string";
|
|
2760
2853
|
required: false;
|
|
@@ -2978,6 +3071,14 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
2978
3071
|
type: "date";
|
|
2979
3072
|
required: false;
|
|
2980
3073
|
};
|
|
3074
|
+
acr: {
|
|
3075
|
+
type: "string";
|
|
3076
|
+
required: false;
|
|
3077
|
+
};
|
|
3078
|
+
amr: {
|
|
3079
|
+
type: "string[]";
|
|
3080
|
+
required: false;
|
|
3081
|
+
};
|
|
2981
3082
|
confirmation: {
|
|
2982
3083
|
type: "json";
|
|
2983
3084
|
required: false;
|
|
@@ -3144,6 +3245,10 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
3144
3245
|
pathMatcher: (path: string) => path is "/oauth2/register";
|
|
3145
3246
|
window: number;
|
|
3146
3247
|
max: number;
|
|
3248
|
+
} | {
|
|
3249
|
+
pathMatcher: (path: string) => path is "/oauth2/client/rotate-keys";
|
|
3250
|
+
window: number;
|
|
3251
|
+
max: number;
|
|
3147
3252
|
} | {
|
|
3148
3253
|
pathMatcher: (path: string) => path is "/oauth2/userinfo";
|
|
3149
3254
|
window: number;
|
|
@@ -3151,4 +3256,4 @@ declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
|
|
|
3151
3256
|
})[];
|
|
3152
3257
|
};
|
|
3153
3258
|
//#endregion
|
|
3154
|
-
export {
|
|
3259
|
+
export { validatePublicClientJwks as a, OAuthEndpointRedirectContext as c, OAuthFieldErrorCodeMap as d, OAuthRedirectOnError as f, oauthDeviceAuthorization as g, OAuthDeviceAuthorizationOptions as h, PublicClientJwksValidationResult as i, OAuthErrorCode as l, DEVICE_CODE_GRANT_TYPE as m, getOAuthProviderState as n, getIssuer as o, createOAuthEndpoint as p, oauthProvider as r, OAuthEndpointErrorResult as s, DEFAULT_OAUTH_SCOPES as t, OAuthFieldErrorCode as u };
|