oauth4webapi 3.4.0 → 3.5.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 CHANGED
@@ -9,6 +9,7 @@ This software provides a collection of routines that can be used to build client
9
9
  The following features are currently in scope and implemented in this software:
10
10
 
11
11
  - Authorization Server Metadata discovery
12
+ - Resource Server Metadata discovery
12
13
  - Authorization Code Flow (profiled under OpenID Connect 1.0, OAuth 2.0, OAuth 2.1, and FAPI 2.0), with PKCE
13
14
  - Refresh Token, Device Authorization, Client-Initiated Backchannel Authentication (CIBA), and Client Credentials Grants
14
15
  - Demonstrating Proof-of-Possession at the Application Layer (DPoP)
@@ -17,6 +18,7 @@ The following features are currently in scope and implemented in this software:
17
18
  - UserInfo and Protected Resource Requests
18
19
  - Authorization Server Issuer Identification
19
20
  - JWT Secured Introspection, Response Mode (JARM), Authorization Request (JAR), and UserInfo
21
+ - Dynamic Client Registration (DCR)
20
22
  - Validating incoming JWT Access Tokens
21
23
 
22
24
  ## Sponsor
@@ -98,6 +100,6 @@ The supported JavaScript runtimes include those that support the utilized Web AP
98
100
  [sponsor-auth0]: https://a0.to/signup/panva
99
101
  [Security Policy]: https://github.com/panva/oauth4webapi/security/policy
100
102
 
101
- [^cjs]: CJS style `let oauth = require('oauth4webapi')` is possible in Node.js versions where `process.features.require_module` is `true` by default (^20.19.0 || ^22.12.0 || >= 23.0.0) or with the `--experimental-require-module` Node.js CLI flag.
103
+ [^cjs]: CJS style `let oauth = require('oauth4webapi')` is possible in Node.js versions where the `require(esm)` feature is enabled by default (^20.19.0 || ^22.12.0 || >= 23.0.0).
102
104
 
103
105
  [^nodejs]: Node.js v20.x as baseline is required
package/build/index.d.ts CHANGED
@@ -394,6 +394,8 @@ export declare const jwksCache: unique symbol;
394
394
  /**
395
395
  * Authorization Server Metadata
396
396
  *
397
+ * @group Authorization Server Metadata
398
+ *
397
399
  * @see [IANA OAuth Authorization Server Metadata registry](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#authorization-server-metadata)
398
400
  */
399
401
  export interface AuthorizationServer {
@@ -709,6 +711,10 @@ export interface AuthorizationServer {
709
711
  * Boolean value specifying whether the authorization server supports back-channel logout.
710
712
  */
711
713
  readonly backchannel_logout_supported?: boolean;
714
+ /**
715
+ * JSON array containing a list of resource identifiers for OAuth protected resources.
716
+ */
717
+ readonly protected_resources?: string[];
712
718
  readonly [metadata: string]: JsonValue | undefined;
713
719
  }
714
720
  export interface MTLSEndpointAliases extends Pick<AuthorizationServer, 'backchannel_authentication_endpoint' | 'device_authorization_endpoint' | 'introspection_endpoint' | 'pushed_authorization_request_endpoint' | 'revocation_endpoint' | 'token_endpoint' | 'userinfo_endpoint'> {
@@ -935,11 +941,13 @@ export interface DiscoveryRequestOptions extends HttpRequestOptions<'GET'> {
935
941
  *
936
942
  * @param issuerIdentifier Issuer Identifier to resolve the well-known discovery URI for.
937
943
  *
944
+ * @returns Resolves with a {@link !Response} to then invoke {@link processDiscoveryResponse} with
945
+ *
938
946
  * @group Authorization Server Metadata
939
947
  * @group OpenID Connect (OIDC) Discovery
940
948
  *
941
949
  * @see [RFC 8414 - OAuth 2.0 Authorization Server Metadata](https://www.rfc-editor.org/rfc/rfc8414.html#section-3)
942
- * @see [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig)
950
+ * @see [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0-errata2.html#ProviderConfig)
943
951
  */
944
952
  export declare function discoveryRequest(issuerIdentifier: URL, options?: DiscoveryRequestOptions): Promise<Response>;
945
953
  /**
@@ -955,7 +963,7 @@ export declare function discoveryRequest(issuerIdentifier: URL, options?: Discov
955
963
  * @group OpenID Connect (OIDC) Discovery
956
964
  *
957
965
  * @see [RFC 8414 - OAuth 2.0 Authorization Server Metadata](https://www.rfc-editor.org/rfc/rfc8414.html#section-3)
958
- * @see [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig)
966
+ * @see [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0-errata2.html#ProviderConfig)
959
967
  */
960
968
  export declare function processDiscoveryResponse(expectedIssuerIdentifier: URL, response: Response): Promise<AuthorizationServer>;
961
969
  /**
@@ -982,7 +990,7 @@ export declare function generateRandomState(): string;
982
990
  *
983
991
  * @group Utilities
984
992
  *
985
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#IDToken)
993
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#IDToken)
986
994
  */
987
995
  export declare function generateRandomNonce(): string;
988
996
  /**
@@ -1035,7 +1043,7 @@ export type ClientAuth = (as: AuthorizationServer, client: Client, body: URLSear
1035
1043
  *
1036
1044
  * @see [OAuth Token Endpoint Authentication Methods](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#token-endpoint-auth-method)
1037
1045
  * @see [RFC 6749 - The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749.html#section-2.3)
1038
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication)
1046
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#ClientAuthentication)
1039
1047
  */
1040
1048
  export declare function ClientSecretPost(clientSecret: string): ClientAuth;
1041
1049
  /**
@@ -1056,7 +1064,7 @@ export declare function ClientSecretPost(clientSecret: string): ClientAuth;
1056
1064
  *
1057
1065
  * @see [OAuth Token Endpoint Authentication Methods](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#token-endpoint-auth-method)
1058
1066
  * @see [RFC 6749 - The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749.html#section-2.3)
1059
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication)
1067
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#ClientAuthentication)
1060
1068
  */
1061
1069
  export declare function ClientSecretBasic(clientSecret: string): ClientAuth;
1062
1070
  export interface ModifyAssertionOptions {
@@ -1085,7 +1093,7 @@ export interface ModifyAssertionOptions {
1085
1093
  * @group Client Authentication
1086
1094
  *
1087
1095
  * @see [OAuth Token Endpoint Authentication Methods](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#token-endpoint-auth-method)
1088
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication)
1096
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#ClientAuthentication)
1089
1097
  */
1090
1098
  export declare function PrivateKeyJwt(clientPrivateKey: CryptoKey | PrivateKey, options?: ModifyAssertionOptions): ClientAuth;
1091
1099
  /**
@@ -1107,7 +1115,7 @@ export declare function PrivateKeyJwt(clientPrivateKey: CryptoKey | PrivateKey,
1107
1115
  * @group Client Authentication
1108
1116
  *
1109
1117
  * @see [OAuth Token Endpoint Authentication Methods](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#token-endpoint-auth-method)
1110
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication)
1118
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#ClientAuthentication)
1111
1119
  */
1112
1120
  export declare function ClientSecretJwt(clientSecret: string, options?: ModifyAssertionOptions): ClientAuth;
1113
1121
  /**
@@ -1121,7 +1129,7 @@ export declare function ClientSecretJwt(clientSecret: string, options?: ModifyAs
1121
1129
  * @group Client Authentication
1122
1130
  *
1123
1131
  * @see [OAuth Token Endpoint Authentication Methods](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#token-endpoint-auth-method)
1124
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication)
1132
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#ClientAuthentication)
1125
1133
  */
1126
1134
  export declare function None(): ClientAuth;
1127
1135
  /**
@@ -1166,6 +1174,9 @@ export declare function checkProtocol(url: URL, enforceHttps: boolean | undefine
1166
1174
  * @param clientAuthentication Client Authentication Method.
1167
1175
  * @param parameters Authorization Request parameters.
1168
1176
  *
1177
+ * @returns Resolves with a {@link !Response} to then invoke
1178
+ * {@link processPushedAuthorizationResponse} with
1179
+ *
1169
1180
  * @group Pushed Authorization Requests (PAR)
1170
1181
  *
1171
1182
  * @see [RFC 9126 - OAuth 2.0 Pushed Authorization Requests (PAR)](https://www.rfc-editor.org/rfc/rfc9126.html#name-pushed-authorization-reques)
@@ -1214,7 +1225,7 @@ export declare function isDPoPNonceError(err: unknown): boolean;
1214
1225
  *
1215
1226
  * @group DPoP
1216
1227
  *
1217
- * @see {@link !DPoP RFC 9449 - OAuth 2.0 Demonstrating Proof of Possession (DPoP)}
1228
+ * @see {@link https://www.rfc-editor.org/rfc/rfc9449.html RFC 9449 - OAuth 2.0 Demonstrating Proof of Possession (DPoP)}
1218
1229
  */
1219
1230
  export declare function DPoP(client: Pick<Client, typeof clockSkew>, keyPair: CryptoKeyPair, options?: ModifyAssertionOptions): DPoPHandle;
1220
1231
  export interface PushedAuthorizationResponse {
@@ -1315,8 +1326,8 @@ export declare class AuthorizationResponseError extends Error {
1315
1326
  });
1316
1327
  }
1317
1328
  /**
1318
- * Thrown when a server responds with WWW-Authenticate challenges, typically because of expired
1319
- * tokens, or bad client authentication
1329
+ * Thrown when a server responds with a parseable WWW-Authenticate challenges, typically because of
1330
+ * expired tokens, or bad client authentication
1320
1331
  *
1321
1332
  * @example
1322
1333
  *
@@ -1351,24 +1362,66 @@ export declare class WWWAuthenticateChallengeError extends Error {
1351
1362
  response: Response;
1352
1363
  });
1353
1364
  }
1365
+ /**
1366
+ * WWW-Authenticate challenge auth-param dictionary with known and unknown parameter names
1367
+ */
1354
1368
  export interface WWWAuthenticateChallengeParameters {
1369
+ /**
1370
+ * Identifies the protection space
1371
+ */
1355
1372
  readonly realm?: string;
1373
+ /**
1374
+ * A machine-readable error code value
1375
+ */
1356
1376
  readonly error?: string;
1377
+ /**
1378
+ * Human-readable ASCII text providing additional information, used to assist the client developer
1379
+ * in understanding the error that occurred
1380
+ */
1357
1381
  readonly error_description?: string;
1382
+ /**
1383
+ * A URI identifying a human-readable web page with information about the error, used to provide
1384
+ * the client developer with additional information about the error
1385
+ */
1358
1386
  readonly error_uri?: string;
1387
+ /**
1388
+ * A comma-delimited list of supported algorithms, used in
1389
+ * {@link https://www.rfc-editor.org/rfc/rfc9449.html RFC 9449 - OAuth 2.0 Demonstrating Proof of Possession (DPoP)}
1390
+ * challenges
1391
+ */
1359
1392
  readonly algs?: string;
1393
+ /**
1394
+ * The scope necessary to access the protected resource, used with `insufficient_scope` error code
1395
+ */
1360
1396
  readonly scope?: string;
1397
+ /**
1398
+ * The URL of the protected resource metadata
1399
+ */
1400
+ readonly resource_metadata?: string;
1361
1401
  /**
1362
1402
  * NOTE: because the parameter names are case insensitive they are always returned lowercased
1363
1403
  */
1364
1404
  readonly [parameter: Lowercase<string>]: string | undefined;
1365
1405
  }
1406
+ /**
1407
+ * Parsed WWW-Authenticate challenge
1408
+ */
1366
1409
  export interface WWWAuthenticateChallenge {
1367
1410
  /**
1411
+ * Parsed WWW-Authenticate challenge auth-scheme
1412
+ *
1368
1413
  * NOTE: because the value is case insensitive it is always returned lowercased
1369
1414
  */
1370
1415
  readonly scheme: Lowercase<string>;
1416
+ /**
1417
+ * Parsed WWW-Authenticate challenge auth-param dictionary (always present but will be empty when
1418
+ * {@link WWWAuthenticateChallenge.token68 token68} is present)
1419
+ */
1371
1420
  readonly parameters: WWWAuthenticateChallengeParameters;
1421
+ /**
1422
+ * Parsed WWW-Authenticate challenge token68
1423
+ */
1424
+ readonly token68?: string;
1372
1425
  }
1373
1426
  /**
1374
1427
  * Validates {@link !Response} instance to be one coming from the
@@ -1422,11 +1475,13 @@ export interface UserInfoRequestOptions extends HttpRequestOptions<'GET'>, DPoPR
1422
1475
  * @param client Client Metadata.
1423
1476
  * @param accessToken Access Token value.
1424
1477
  *
1478
+ * @returns Resolves with a {@link !Response} to then invoke {@link processUserInfoResponse} with
1479
+ *
1425
1480
  * @group Authorization Code Grant w/ OpenID Connect (OIDC)
1426
1481
  * @group OpenID Connect (OIDC) UserInfo
1427
1482
  * @group Accessing Protected Resources
1428
1483
  *
1429
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo)
1484
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#UserInfo)
1430
1485
  * @see [RFC 9449 - OAuth 2.0 Demonstrating Proof-of-Possession at the Application Layer (DPoP)](https://www.rfc-editor.org/rfc/rfc9449.html#name-protected-resource-access)
1431
1486
  */
1432
1487
  export declare function userInfoRequest(as: AuthorizationServer, client: Client, accessToken: string, options?: UserInfoRequestOptions): Promise<Response>;
@@ -1473,7 +1528,7 @@ export type JWKSCacheInput = ExportedJWKSCache | Record<string, never>;
1473
1528
  * Use this as a value to {@link processUserInfoResponse} `expectedSubject` parameter to skip the
1474
1529
  * `sub` claim value check.
1475
1530
  *
1476
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#UserInfoResponse)
1531
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#UserInfoResponse)
1477
1532
  */
1478
1533
  export declare const skipSubjectCheck: unique symbol;
1479
1534
  export interface JWEDecryptOptions {
@@ -1500,7 +1555,7 @@ export interface JWEDecryptOptions {
1500
1555
  * @group OpenID Connect (OIDC) UserInfo
1501
1556
  * @group Accessing Protected Resources
1502
1557
  *
1503
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo)
1558
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#UserInfo)
1504
1559
  */
1505
1560
  export declare function processUserInfoResponse(as: AuthorizationServer, client: Client, expectedSubject: string | typeof skipSubjectCheck, response: Response, options?: JWEDecryptOptions): Promise<UserInfoResponse>;
1506
1561
  export interface TokenEndpointRequestOptions extends HttpRequestOptions<'POST', URLSearchParams>, DPoPRequestOptions {
@@ -1518,10 +1573,12 @@ export interface TokenEndpointRequestOptions extends HttpRequestOptions<'POST',
1518
1573
  * @param clientAuthentication Client Authentication Method.
1519
1574
  * @param refreshToken Refresh Token value.
1520
1575
  *
1576
+ * @returns Resolves with a {@link !Response} to then invoke {@link processRefreshTokenResponse} with
1577
+ *
1521
1578
  * @group Refreshing an Access Token
1522
1579
  *
1523
1580
  * @see [RFC 6749 - The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749.html#section-6)
1524
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokens)
1581
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#RefreshTokens)
1525
1582
  * @see [RFC 9449 - OAuth 2.0 Demonstrating Proof-of-Possession at the Application Layer (DPoP)](https://www.rfc-editor.org/rfc/rfc9449.html#name-dpop-access-token-request)
1526
1583
  */
1527
1584
  export declare function refreshTokenGrantRequest(as: AuthorizationServer, client: Client, clientAuthentication: ClientAuth, refreshToken: string, options?: TokenEndpointRequestOptions): Promise<Response>;
@@ -1566,7 +1623,7 @@ export interface ValidateSignatureOptions extends HttpRequestOptions<'GET'>, JWK
1566
1623
  * @group Token Introspection
1567
1624
  *
1568
1625
  * @see [RFC 9701 - JWT Response for OAuth Token Introspection](https://www.rfc-editor.org/rfc/rfc9701.html#section-5)
1569
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo)
1626
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#UserInfo)
1570
1627
  */
1571
1628
  export declare function validateApplicationLevelSignature(as: AuthorizationServer, ref: Response, options?: ValidateSignatureOptions): Promise<void>;
1572
1629
  /**
@@ -1584,7 +1641,7 @@ export declare function validateApplicationLevelSignature(as: AuthorizationServe
1584
1641
  * @group Refreshing an Access Token
1585
1642
  *
1586
1643
  * @see [RFC 6749 - The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749.html#section-6)
1587
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokens)
1644
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#RefreshTokens)
1588
1645
  */
1589
1646
  export declare function processRefreshTokenResponse(as: AuthorizationServer, client: Client, response: Response, options?: JWEDecryptOptions): Promise<TokenEndpointResponse>;
1590
1647
  /**
@@ -1599,11 +1656,14 @@ export declare function processRefreshTokenResponse(as: AuthorizationServer, cli
1599
1656
  * @param redirectUri `redirect_uri` value used in the authorization request.
1600
1657
  * @param codeVerifier PKCE `code_verifier` to send to the token endpoint.
1601
1658
  *
1659
+ * @returns Resolves with a {@link !Response} to then invoke {@link processAuthorizationCodeResponse}
1660
+ * with
1661
+ *
1602
1662
  * @group Authorization Code Grant
1603
1663
  * @group Authorization Code Grant w/ OpenID Connect (OIDC)
1604
1664
  *
1605
1665
  * @see [RFC 6749 - The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749.html#section-4.1)
1606
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth)
1666
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#CodeFlowAuth)
1607
1667
  * @see [RFC 7636 - Proof Key for Code Exchange (PKCE)](https://www.rfc-editor.org/rfc/rfc7636.html#section-4)
1608
1668
  * @see [RFC 9449 - OAuth 2.0 Demonstrating Proof-of-Possession at the Application Layer (DPoP)](https://www.rfc-editor.org/rfc/rfc9449.html#name-dpop-access-token-request)
1609
1669
  */
@@ -1696,7 +1756,7 @@ export interface ProcessAuthorizationCodeResponseOptions extends JWEDecryptOptio
1696
1756
  * @group Authorization Code Grant w/ OpenID Connect (OIDC)
1697
1757
  *
1698
1758
  * @see [RFC 6749 - The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749.html#section-4.1)
1699
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth)
1759
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#CodeFlowAuth)
1700
1760
  */
1701
1761
  export declare function processAuthorizationCodeResponse(as: AuthorizationServer, client: Client, response: Response, options?: ProcessAuthorizationCodeResponseOptions): Promise<TokenEndpointResponse>;
1702
1762
  /**
@@ -1836,6 +1896,9 @@ export interface ClientCredentialsGrantRequestOptions extends HttpRequestOptions
1836
1896
  * @param client Client Metadata.
1837
1897
  * @param clientAuthentication Client Authentication Method.
1838
1898
  *
1899
+ * @returns Resolves with a {@link !Response} to then invoke {@link processClientCredentialsResponse}
1900
+ * with
1901
+ *
1839
1902
  * @group Client Credentials Grant
1840
1903
  *
1841
1904
  * @see [RFC 6749 - The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749.html#section-4.4)
@@ -1852,6 +1915,9 @@ export declare function clientCredentialsGrantRequest(as: AuthorizationServer, c
1852
1915
  * @param clientAuthentication Client Authentication Method.
1853
1916
  * @param grantType Grant Type.
1854
1917
  *
1918
+ * @returns Resolves with a {@link !Response} to then invoke
1919
+ * {@link processGenericTokenEndpointResponse} with
1920
+ *
1855
1921
  * @group JWT Bearer Token Grant Type
1856
1922
  * @group SAML 2.0 Bearer Assertion Grant Type
1857
1923
  * @group Token Exchange Grant Type
@@ -1911,6 +1977,8 @@ export interface RevocationRequestOptions extends HttpRequestOptions<'POST', URL
1911
1977
  * @param token Token to revoke. You can provide the `token_type_hint` parameter via
1912
1978
  * {@link RevocationRequestOptions.additionalParameters options}.
1913
1979
  *
1980
+ * @returns Resolves with a {@link !Response} to then invoke {@link processRevocationResponse} with
1981
+ *
1914
1982
  * @group Token Revocation
1915
1983
  *
1916
1984
  * @see [RFC 7009 - OAuth 2.0 Token Revocation](https://www.rfc-editor.org/rfc/rfc7009.html#section-2)
@@ -1956,6 +2024,8 @@ export interface IntrospectionRequestOptions extends HttpRequestOptions<'POST',
1956
2024
  * @param token Token to introspect. You can provide the `token_type_hint` parameter via
1957
2025
  * {@link IntrospectionRequestOptions.additionalParameters options}.
1958
2026
  *
2027
+ * @returns Resolves with a {@link !Response} to then invoke {@link processIntrospectionResponse} with
2028
+ *
1959
2029
  * @group Token Introspection
1960
2030
  *
1961
2031
  * @see [RFC 7662 - OAuth 2.0 Token Introspection](https://www.rfc-editor.org/rfc/rfc7662.html#section-2)
@@ -2024,7 +2094,7 @@ export type JweDecryptFunction = (jwe: string) => Promise<string>;
2024
2094
  * @group FAPI 2.0 Message Signing
2025
2095
  * @group FAPI 1.0 Advanced
2026
2096
  *
2027
- * @see [JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)](https://openid.net/specs/openid-financial-api-jarm.html)
2097
+ * @see [JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)](https://openid.net/specs/openid-financial-api-jarm-final.html)
2028
2098
  */
2029
2099
  export declare function validateJwtAuthResponse(as: AuthorizationServer, client: Client, parameters: URLSearchParams | URL, expectedState?: string | typeof expectNoState | typeof skipStateCheck, options?: ValidateSignatureOptions & JWEDecryptOptions): Promise<URLSearchParams>;
2030
2100
  /**
@@ -2048,7 +2118,7 @@ export declare function validateJwtAuthResponse(as: AuthorizationServer, client:
2048
2118
  *
2049
2119
  * @group FAPI 1.0 Advanced
2050
2120
  *
2051
- * @see [Financial-grade API Security Profile 1.0 - Part 2: Advanced](https://openid.net/specs/openid-financial-api-part-2-1_0.html#id-token-as-detached-signature)
2121
+ * @see [Financial-grade API Security Profile 1.0 - Part 2: Advanced](https://openid.net/specs/openid-financial-api-part-2-1_0-final.html#id-token-as-detached-signature)
2052
2122
  */
2053
2123
  export declare function validateDetachedSignatureResponse(as: AuthorizationServer, client: Client, parameters: URLSearchParams | URL | Request, expectedNonce: string, expectedState?: string | typeof expectNoState, maxAge?: number | typeof skipAuthTimeCheck, options?: ValidateSignatureOptions & JWEDecryptOptions): Promise<URLSearchParams>;
2054
2124
  /**
@@ -2072,7 +2142,7 @@ export declare function validateDetachedSignatureResponse(as: AuthorizationServe
2072
2142
  * @group Authorization Code Grant w/ OpenID Connect (OIDC)
2073
2143
  *
2074
2144
  * @see [RFC 6749 - The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749.html#section-4.1.2)
2075
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#HybridFlowAuth)
2145
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#HybridFlowAuth)
2076
2146
  */
2077
2147
  export declare function validateCodeIdTokenResponse(as: AuthorizationServer, client: Client, parameters: URLSearchParams | URL | Request, expectedNonce: string, expectedState?: string | typeof expectNoState, maxAge?: number | typeof skipAuthTimeCheck, options?: ValidateSignatureOptions & JWEDecryptOptions): Promise<URLSearchParams>;
2078
2148
  /**
@@ -2109,7 +2179,7 @@ export declare const expectNoState: unique symbol;
2109
2179
  * @group Authorization Code Grant w/ OpenID Connect (OIDC)
2110
2180
  *
2111
2181
  * @see [RFC 6749 - The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749.html#section-4.1.2)
2112
- * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth)
2182
+ * @see [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0-errata2.html#CodeFlowAuth)
2113
2183
  * @see [RFC 9207 - OAuth 2.0 Authorization Server Issuer Identification](https://www.rfc-editor.org/rfc/rfc9207.html)
2114
2184
  */
2115
2185
  export declare function validateAuthResponse(as: AuthorizationServer, client: Client, parameters: URLSearchParams | URL, expectedState?: string | typeof expectNoState | typeof skipStateCheck): URLSearchParams;
@@ -2124,6 +2194,9 @@ export interface DeviceAuthorizationRequestOptions extends HttpRequestOptions<'P
2124
2194
  * @param clientAuthentication Client Authentication Method.
2125
2195
  * @param parameters Device Authorization Request parameters.
2126
2196
  *
2197
+ * @returns Resolves with a {@link !Response} to then invoke
2198
+ * {@link processDeviceAuthorizationResponse} with
2199
+ *
2127
2200
  * @group Device Authorization Grant
2128
2201
  *
2129
2202
  * @see [RFC 8628 - OAuth 2.0 Device Authorization Grant](https://www.rfc-editor.org/rfc/rfc8628.html#section-3.1)
@@ -2187,6 +2260,8 @@ export declare function processDeviceAuthorizationResponse(as: AuthorizationServ
2187
2260
  * {@link DeviceAuthorizationResponse.device_code `device_code`} retrieved from
2188
2261
  * {@link processDeviceAuthorizationResponse}.
2189
2262
  *
2263
+ * @returns Resolves with a {@link !Response} to then invoke {@link processDeviceCodeResponse} with
2264
+ *
2190
2265
  * @group Device Authorization Grant
2191
2266
  *
2192
2267
  * @see [RFC 8628 - OAuth 2.0 Device Authorization Grant](https://www.rfc-editor.org/rfc/rfc8628.html#section-3.4)
@@ -2303,9 +2378,12 @@ export interface BackchannelAuthenticationRequestOptions extends HttpRequestOpti
2303
2378
  * @param clientAuthentication Client Authentication Method.
2304
2379
  * @param parameters Backchannel Authentication Request parameters.
2305
2380
  *
2381
+ * @returns Resolves with a {@link !Response} to then invoke
2382
+ * {@link processBackchannelAuthenticationResponse} with
2383
+ *
2306
2384
  * @group Client-Initiated Backchannel Authentication (CIBA)
2307
2385
  *
2308
- * @see [OpenID Connect Client-Initiated Backchannel Authentication](https://openid.net/specs/openid-client-initiated-backchannel-authentication-core-1_0.html#auth_request)
2386
+ * @see [OpenID Connect Client-Initiated Backchannel Authentication](https://openid.net/specs/openid-client-initiated-backchannel-authentication-core-1_0-final.html#auth_request)
2309
2387
  */
2310
2388
  export declare function backchannelAuthenticationRequest(as: AuthorizationServer, client: Client, clientAuthentication: ClientAuth, parameters: URLSearchParams | Record<string, string> | string[][], options?: BackchannelAuthenticationRequestOptions): Promise<Response>;
2311
2389
  export interface BackchannelAuthenticationResponse {
@@ -2338,7 +2416,7 @@ export interface BackchannelAuthenticationResponse {
2338
2416
  *
2339
2417
  * @group Client-Initiated Backchannel Authentication (CIBA)
2340
2418
  *
2341
- * @see [OpenID Connect Client-Initiated Backchannel Authentication](https://openid.net/specs/openid-client-initiated-backchannel-authentication-core-1_0.html#auth_request)
2419
+ * @see [OpenID Connect Client-Initiated Backchannel Authentication](https://openid.net/specs/openid-client-initiated-backchannel-authentication-core-1_0-final.html#auth_request)
2342
2420
  */
2343
2421
  export declare function processBackchannelAuthenticationResponse(as: AuthorizationServer, client: Client, response: Response): Promise<BackchannelAuthenticationResponse>;
2344
2422
  /**
@@ -2352,9 +2430,12 @@ export declare function processBackchannelAuthenticationResponse(as: Authorizati
2352
2430
  * {@link BackchannelAuthenticationResponse.auth_req_id `auth_req_id`} retrieved from
2353
2431
  * {@link processBackchannelAuthenticationResponse}.
2354
2432
  *
2433
+ * @returns Resolves with a {@link !Response} to then invoke
2434
+ * {@link processBackchannelAuthenticationGrantResponse} with
2435
+ *
2355
2436
  * @group Client-Initiated Backchannel Authentication (CIBA)
2356
2437
  *
2357
- * @see [OpenID Connect Client-Initiated Backchannel Authentication](https://openid.net/specs/openid-client-initiated-backchannel-authentication-core-1_0.html#token_request)
2438
+ * @see [OpenID Connect Client-Initiated Backchannel Authentication](https://openid.net/specs/openid-client-initiated-backchannel-authentication-core-1_0-final.html#token_request)
2358
2439
  * @see [RFC 9449 - OAuth 2.0 Demonstrating Proof-of-Possession at the Application Layer (DPoP)](https://www.rfc-editor.org/rfc/rfc9449.html#name-dpop-access-token-request)
2359
2440
  */
2360
2441
  export declare function backchannelAuthenticationGrantRequest(as: AuthorizationServer, client: Client, clientAuthentication: ClientAuth, authReqId: string, options?: TokenEndpointRequestOptions): Promise<Response>;
@@ -2372,7 +2453,7 @@ export declare function backchannelAuthenticationGrantRequest(as: AuthorizationS
2372
2453
  *
2373
2454
  * @group Client-Initiated Backchannel Authentication (CIBA)
2374
2455
  *
2375
- * @see [OpenID Connect Client-Initiated Backchannel Authentication](https://openid.net/specs/openid-client-initiated-backchannel-authentication-core-1_0.html#token_request)
2456
+ * @see [OpenID Connect Client-Initiated Backchannel Authentication](https://openid.net/specs/openid-client-initiated-backchannel-authentication-core-1_0-final.html#token_request)
2376
2457
  */
2377
2458
  export declare function processBackchannelAuthenticationGrantResponse(as: AuthorizationServer, client: Client, response: Response, options?: JWEDecryptOptions): Promise<TokenEndpointResponse>;
2378
2459
  /**
@@ -2393,6 +2474,13 @@ export interface DynamicClientRegistrationRequestOptions extends HttpRequestOpti
2393
2474
  * {@link AuthorizationServer.registration_endpoint `as.registration_endpoint`} using the provided
2394
2475
  * client metadata.
2395
2476
  *
2477
+ * @param as Authorization Server Metadata.
2478
+ * @param metadata Requested Client Metadata.
2479
+ * @param options
2480
+ *
2481
+ * @returns Resolves with a {@link !Response} to then invoke
2482
+ * {@link processDynamicClientRegistrationResponse} with
2483
+ *
2396
2484
  * @group Dynamic Client Registration (DCR)
2397
2485
  *
2398
2486
  * @see [RFC 7591 - OAuth 2.0 Dynamic Client Registration Protocol (DCR)](https://www.rfc-editor.org/rfc/rfc7591.html#section-3.1)
@@ -2416,4 +2504,113 @@ export declare function dynamicClientRegistrationRequest(as: AuthorizationServer
2416
2504
  * @see [OpenID Connect Dynamic Client Registration 1.0 (DCR)](https://openid.net/specs/openid-connect-registration-1_0-errata2.html#RegistrationResponse)
2417
2505
  */
2418
2506
  export declare function processDynamicClientRegistrationResponse(response: Response): Promise<OmitSymbolProperties<Client>>;
2507
+ /**
2508
+ * Protected Resource Server Metadata
2509
+ *
2510
+ * @group Resource Server Metadata
2511
+ *
2512
+ * @see [IANA OAuth Protected Resource Server Metadata registry](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#protected-resource-server-metadata)
2513
+ */
2514
+ export interface ResourceServer {
2515
+ /**
2516
+ * Resource server's Resource Identifier URL.
2517
+ */
2518
+ readonly resource: string;
2519
+ /**
2520
+ * JSON array containing a list of OAuth authorization server issuer identifiers
2521
+ */
2522
+ readonly authorization_servers?: string[];
2523
+ /**
2524
+ * URL of the protected resource's JWK Set document
2525
+ */
2526
+ readonly jwks_uri?: string;
2527
+ /**
2528
+ * JSON array containing a list of the OAuth 2.0 scope values that are used in authorization
2529
+ * requests to request access to this protected resource
2530
+ */
2531
+ readonly scopes_supported?: string[];
2532
+ /**
2533
+ * JSON array containing a list of the OAuth 2.0 Bearer Token presentation methods that this
2534
+ * protected resource supports
2535
+ */
2536
+ readonly bearer_methods_supported?: string[];
2537
+ /**
2538
+ * JSON array containing a list of the JWS signing algorithms (alg values) supported by the
2539
+ * protected resource for signed content
2540
+ */
2541
+ readonly resource_signing_alg_values_supported?: string[];
2542
+ /**
2543
+ * Human-readable name of the protected resource
2544
+ */
2545
+ readonly resource_name?: string;
2546
+ /**
2547
+ * URL of a page containing human-readable information that developers might want or need to know
2548
+ * when using the protected resource
2549
+ */
2550
+ readonly resource_documentation?: string;
2551
+ /**
2552
+ * URL of a page containing human-readable information about the protected resource's requirements
2553
+ * on how the client can use the data provided by the protected resource
2554
+ */
2555
+ readonly resource_policy_uri?: string;
2556
+ /**
2557
+ * URL of a page containing human-readable information about the protected resource's terms of
2558
+ * service
2559
+ */
2560
+ readonly resource_tos_uri?: string;
2561
+ /**
2562
+ * Boolean value indicating protected resource support for mutual-TLS client certificate-bound
2563
+ * access tokens
2564
+ */
2565
+ readonly tls_client_certificate_bound_access_tokens?: boolean;
2566
+ /**
2567
+ * JSON array containing a list of the authorization details type values supported by the resource
2568
+ * server when the authorization_details request parameter is used
2569
+ */
2570
+ readonly authorization_details_types_supported?: boolean;
2571
+ /**
2572
+ * JSON array containing a list of the JWS alg values supported by the resource server for
2573
+ * validating DPoP proof JWTs
2574
+ */
2575
+ readonly dpop_signing_alg_values_supported?: boolean;
2576
+ /**
2577
+ * Boolean value specifying whether the protected resource always requires the use of DPoP-bound
2578
+ * access tokens
2579
+ */
2580
+ readonly dpop_bound_access_tokens_required?: boolean;
2581
+ /**
2582
+ * Signed JWT containing metadata parameters about the protected resource as claims
2583
+ */
2584
+ readonly signed_metadata?: string;
2585
+ readonly [metadata: string]: JsonValue | undefined;
2586
+ }
2587
+ /**
2588
+ * Performs a protected resource metadata discovery.
2589
+ *
2590
+ * @param resourceIdentifier Protected resource's resource identifier to resolve the well-known
2591
+ * discovery URI for
2592
+ *
2593
+ * @returns Resolves with a {@link !Response} to then invoke {@link processResourceDiscoveryResponse}
2594
+ * with
2595
+ *
2596
+ * @group Resource Server Metadata
2597
+ *
2598
+ * @see [RFC-to-be 9728 - OAuth 2.0 Protected Resource Metadata](https://www.ietf.org/archive/id/draft-ietf-oauth-resource-metadata-13.html#name-protected-resource-metadata-)
2599
+ */
2600
+ export declare function resourceDiscoveryRequest(resourceIdentifier: URL, options?: HttpRequestOptions<'GET'>): Promise<Response>;
2601
+ /**
2602
+ * Validates {@link !Response} instance to be one coming from the resource server's well-known
2603
+ * discovery endpoint.
2604
+ *
2605
+ * @param expectedResourceIdentifier Expected Resource Identifier value.
2606
+ * @param response Resolved value from {@link resourceDiscoveryRequest} or from a general
2607
+ * {@link !fetch} following {@link WWWAuthenticateChallengeParameters.resource_metadata}.
2608
+ *
2609
+ * @returns Resolves with the discovered Resource Server Metadata.
2610
+ *
2611
+ * @group Resource Server Metadata
2612
+ *
2613
+ * @see [RFC-to-be 9728 - OAuth 2.0 Protected Resource Metadata](https://www.ietf.org/archive/id/draft-ietf-oauth-resource-metadata-13.html#name-protected-resource-metadata-r)
2614
+ */
2615
+ export declare function processResourceDiscoveryResponse(expectedResourceIdentifier: URL, response: Response): Promise<ResourceServer>;
2419
2616
  export {};