@atproto/oauth-client 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +15 -0
- package/dist/oauth-client.d.ts.map +1 -1
- package/dist/oauth-client.js +2 -4
- package/dist/oauth-client.js.map +1 -1
- package/dist/oauth-resolver.d.ts +1 -1
- package/dist/oauth-server-agent.d.ts +2 -2
- package/dist/oauth-server-agent.d.ts.map +1 -1
- package/dist/validate-client-metadata.d.ts.map +1 -1
- package/dist/validate-client-metadata.js +16 -5
- package/dist/validate-client-metadata.js.map +1 -1
- package/package.json +6 -6
- package/src/oauth-client.ts +2 -6
- package/src/oauth-server-agent.ts +2 -2
- package/src/validate-client-metadata.ts +23 -6
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# @atproto/oauth-client
|
2
2
|
|
3
|
+
## 0.2.2
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Improve client side validation of client metadata
|
8
|
+
|
9
|
+
- [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Use scope from client metadata as default value
|
10
|
+
|
11
|
+
- Updated dependencies [[`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8), [`a07b21151`](https://github.com/bluesky-social/atproto/commit/a07b21151f1850340c4b7797ebb11521b1a6cdf3), [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8), [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8), [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8), [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8), [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8), [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8), [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8), [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8), [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8), [`a07b21151`](https://github.com/bluesky-social/atproto/commit/a07b21151f1850340c4b7797ebb11521b1a6cdf3), [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8), [`a07b21151`](https://github.com/bluesky-social/atproto/commit/a07b21151f1850340c4b7797ebb11521b1a6cdf3), [`a07b21151`](https://github.com/bluesky-social/atproto/commit/a07b21151f1850340c4b7797ebb11521b1a6cdf3)]:
|
12
|
+
- @atproto/oauth-types@0.1.5
|
13
|
+
- @atproto/xrpc@0.6.3
|
14
|
+
- @atproto-labs/fetch@0.1.1
|
15
|
+
- @atproto-labs/did-resolver@0.1.4
|
16
|
+
- @atproto-labs/identity-resolver@0.1.4
|
17
|
+
|
3
18
|
## 0.2.1
|
4
19
|
|
5
20
|
### Patch Changes
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"oauth-client.d.ts","sourceRoot":"","sources":["../src/oauth-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGT,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAGL,WAAW,EACX,cAAc,EACf,MAAM,+BAA+B,CAAA;AACtC,O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EAC/D,WAAuB,EACvB,gCAGE,EACF,8BAGE,EAEF,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,MAAM,GACP,EAAE,kBAAkB;IA4DrB,IAAI,gBAAgB,qBAEnB;IAGD,IAAI,WAAW,qHAEd;IAGD,IAAI,cAAc,mBAEjB;IAED,IAAI,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEP;IAEK,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC;IAoFxE;;;OAGG;IACG,YAAY,CAAC,YAAY,EAAE,GAAG;IAY9B,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC;QAC/C,OAAO,EAAE,YAAY,CAAA;QACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KACrB,CAAC;IA2FF;;;;;OAKG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC;IAc9D,MAAM,CAAC,GAAG,EAAE,MAAM;IAiBxB,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY;CAG7E"}
|
package/dist/oauth-client.js
CHANGED
@@ -169,12 +169,10 @@ class OAuthClient extends util_js_1.CustomEventTarget {
|
|
169
169
|
? input // If input is a handle or a DID, use it as a login_hint
|
170
170
|
: undefined,
|
171
171
|
response_mode: this.responseMode,
|
172
|
-
response_type:
|
173
|
-
// Negotiate by using the order in the client metadata
|
174
|
-
this.clientMetadata.response_types?.find((t) => metadata['response_types_supported']?.includes(t)) ?? 'code',
|
172
|
+
response_type: 'code',
|
175
173
|
display: options?.display,
|
176
174
|
prompt: options?.prompt,
|
177
|
-
scope: options?.scope
|
175
|
+
scope: options?.scope ?? this.clientMetadata.scope,
|
178
176
|
ui_locales: options?.ui_locales,
|
179
177
|
};
|
180
178
|
if (metadata.pushed_authorization_request_endpoint) {
|
package/dist/oauth-client.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"oauth-client.js","sourceRoot":"","sources":["../src/oauth-client.ts"],"names":[],"mappings":";;;AAAA,6DAImC;AAEnC,mEAKsC;AACtC,uEAAkE;AAClE,2EAAqE;AACrE,sCAA0C;AAC1C,sDAM6B;AAE7B,iDAA6C;AAC7C,4EAAmE;AACnE,uHAG0D;AAC1D,uEAA8D;AAC9D,mHAGwD;AACxD,2DAAmD;AAEnD,uEAA8D;AAC9D,yDAAiD;AAEjD,6CAAsC;AACtC,2DAI4B;AAG5B,uCAA6C;AAC7C,+EAAsE;AAoDtE,MAAa,WAAY,SAAQ,2BAAsC;IACrE,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,EACzB,QAAQ,EACR,KAAK,GAAG,UAAU,CAAC,KAAK,EACxB,MAAM,GAC0B;QAChC,MAAM,EAAE,cAAc,EAAE,CAAA;QAExB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpC,QAAQ,EAAE,OAAO;YACjB,MAAM,EAAE,MAAM;SACf,CAAC,CAAA;QACF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,CAAA;QAErC,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAA;YACzB,MAAM,IAAI,SAAS,CAAC,oCAAoC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;QAC5E,CAAC;QAED,8IAA8I;QAC9I,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IA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,YAAY,CAAC,CAAA;QAC5C,CAAC;gBAAS,CAAC;YACT,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,0CAAiB,CAAC,GAAG,CAAC,CAAC,CAAA;QACrE,CAAC;IACH,CAAC;IAES,aAAa,CAAC,MAAwB,EAAE,GAAW;QAC3D,OAAO,IAAI,+BAAY,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IACtE,CAAC;CACF;AAhYD,kCAgYC"}
|
package/dist/oauth-resolver.d.ts
CHANGED
@@ -45,7 +45,7 @@ export declare class OAuthResolver {
|
|
45
45
|
response_types_supported?: string[] | undefined;
|
46
46
|
response_modes_supported?: string[] | undefined;
|
47
47
|
grant_types_supported?: string[] | undefined;
|
48
|
-
code_challenge_methods_supported?:
|
48
|
+
code_challenge_methods_supported?: ("S256" | "plain")[] | undefined;
|
49
49
|
ui_locales_supported?: string[] | undefined;
|
50
50
|
id_token_signing_alg_values_supported?: string[] | undefined;
|
51
51
|
display_values_supported?: string[] | undefined;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Fetch, Json } from '@atproto-labs/fetch';
|
2
2
|
import { SimpleStore } from '@atproto-labs/simple-store';
|
3
3
|
import { Key, Keyset } from '@atproto/jwk';
|
4
|
-
import { OAuthAuthorizationServerMetadata,
|
4
|
+
import { OAuthAuthorizationServerMetadata, OAuthClientCredentials, OAuthEndpointName, OAuthParResponse, OAuthTokenResponse, OAuthTokenType } from '@atproto/oauth-types';
|
5
5
|
import { OAuthResolver } from './oauth-resolver.js';
|
6
6
|
import { Runtime } from './runtime.js';
|
7
7
|
import { ClientMetadata } from './types.js';
|
@@ -44,7 +44,7 @@ export declare class OAuthServerAgent {
|
|
44
44
|
request(endpoint: OAuthEndpointName, payload: Record<string, unknown>): Promise<Json>;
|
45
45
|
buildClientAuth(endpoint: OAuthEndpointName): Promise<{
|
46
46
|
headers?: Record<string, string>;
|
47
|
-
payload:
|
47
|
+
payload: OAuthClientCredentials;
|
48
48
|
}>;
|
49
49
|
}
|
50
50
|
//# sourceMappingURL=oauth-server-agent.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"oauth-server-agent.d.ts","sourceRoot":"","sources":["../src/oauth-server-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAiC,MAAM,qBAAqB,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAEL,gCAAgC,EAChC,
|
1
|
+
{"version":3,"file":"oauth-server-agent.d.ts","sourceRoot":"","sources":["../src/oauth-server-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAiC,MAAM,qBAAqB,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAEL,gCAAgC,EAChC,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EAGf,MAAM,sBAAsB,CAAA;AAK7B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAG3C,MAAM,MAAM,QAAQ,GAAG;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IAEb,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,cAAc,CAAA;IAC1B,eAAe;IACf,UA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EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,IAAI,CAAC;IA4BV,eAAe,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAC1D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAChC,OAAO,EAAE,sBAAsB,CAAA;KAChC,CAAC;CA+DH"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"validate-client-metadata.d.ts","sourceRoot":"","sources":["../src/validate-client-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,
|
1
|
+
{"version":3,"file":"validate-client-metadata.d.ts","sourceRoot":"","sources":["../src/validate-client-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EACL,wBAAwB,EAGzB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,cAAc,EAAwB,MAAM,YAAY,CAAA;AAKjE,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,wBAAwB,EAC/B,MAAM,CAAC,EAAE,MAAM,GACd,cAAc,CAuEhB"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.validateClientMetadata = void 0;
|
4
|
+
const oauth_types_1 = require("@atproto/oauth-types");
|
4
5
|
const types_js_1 = require("./types.js");
|
5
6
|
const TOKEN_ENDPOINT_AUTH_METHOD = `token_endpoint_auth_method`;
|
6
7
|
const TOKEN_ENDPOINT_AUTH_SIGNING_ALG = `token_endpoint_auth_signing_alg`;
|
@@ -23,12 +24,22 @@ function validateClientMetadata(input, keyset) {
|
|
23
24
|
input = { ...input, jwks: keyset.toJSON() };
|
24
25
|
}
|
25
26
|
const metadata = types_js_1.clientMetadataSchema.parse(input);
|
26
|
-
//
|
27
|
-
|
28
|
-
|
27
|
+
// Validate client ID
|
28
|
+
if (metadata.client_id.startsWith('http:')) {
|
29
|
+
(0, oauth_types_1.assertOAuthLoopbackClientId)(metadata.client_id);
|
29
30
|
}
|
30
|
-
|
31
|
-
|
31
|
+
else {
|
32
|
+
(0, oauth_types_1.assertOAuthDiscoverableClientId)(metadata.client_id);
|
33
|
+
}
|
34
|
+
const scopes = metadata.scope?.split(' ');
|
35
|
+
if (!scopes?.includes('atproto')) {
|
36
|
+
throw new TypeError(`Client metadata must include the "atproto" scope`);
|
37
|
+
}
|
38
|
+
if (!metadata.response_types.includes('code')) {
|
39
|
+
throw new TypeError(`"response_types" must include "code"`);
|
40
|
+
}
|
41
|
+
if (!metadata.grant_types.includes('authorization_code')) {
|
42
|
+
throw new TypeError(`"grant_types" must include "authorization_code"`);
|
32
43
|
}
|
33
44
|
const method = metadata[TOKEN_ENDPOINT_AUTH_METHOD];
|
34
45
|
switch (method) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"validate-client-metadata.js","sourceRoot":"","sources":["../src/validate-client-metadata.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"validate-client-metadata.js","sourceRoot":"","sources":["../src/validate-client-metadata.ts"],"names":[],"mappings":";;;AACA,sDAI6B;AAE7B,yCAAiE;AAEjE,MAAM,0BAA0B,GAAG,4BAA4B,CAAA;AAC/D,MAAM,+BAA+B,GAAG,iCAAiC,CAAA;AAEzE,SAAgB,sBAAsB,CACpC,KAA+B,EAC/B,MAAe;IAEf,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,SAAS,CAAC,mDAAmD,CAAC,CAAA;QAC1E,CAAC;QACD,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAClC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;gBACb,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAA;YACvD,CAAC;iBA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AAG,QAAQ,CAAC,0BAA0B,CAAC,CAAA;IACnD,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,SAAS;YACZ,MAAM,IAAI,SAAS,CAAC,GAAG,0BAA0B,mBAAmB,CAAC,CAAA;QACvE,KAAK,MAAM;YACT,IAAI,QAAQ,CAAC,+BAA+B,CAAC,EAAE,CAAC;gBAC9C,MAAM,IAAI,SAAS,CACjB,GAAG,+BAA+B,8BAA8B,0BAA0B,QAAQ,MAAM,GAAG,CAC5G,CAAA;YACH,CAAC;YACD,MAAK;QACP,KAAK,iBAAiB;YACpB,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC;gBAClB,MAAM,IAAI,SAAS,CACjB,4CAA4C,0BAA0B,QAAQ,MAAM,GAAG,CACxF,CAAA;YACH,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,+BAA+B,CAAC,EAAE,CAAC;gBAC/C,MAAM,IAAI,SAAS,CACjB,GAAG,+BAA+B,0BAA0B,0BAA0B,QAAQ,MAAM,GAAG,CACxG,CAAA;YACH,CAAC;YACD,MAAK;QACP;YACE,MAAM,IAAI,SAAS,CACjB,+CAA+C,MAAM,EAAE,CACxD,CAAA;IACL,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC;AA1ED,wDA0EC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atproto/oauth-client",
|
3
|
-
"version": "0.2.
|
3
|
+
"version": "0.2.2",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "OAuth client for ATPROTO PDS. This package serves as common base for environment-specific implementations (NodeJS, Browser, React-Native).",
|
6
6
|
"keywords": [
|
@@ -27,16 +27,16 @@
|
|
27
27
|
"dependencies": {
|
28
28
|
"multiformats": "^9.9.0",
|
29
29
|
"zod": "^3.23.8",
|
30
|
-
"@atproto-labs/did-resolver": "0.1.
|
31
|
-
"@atproto-labs/fetch": "0.1.
|
30
|
+
"@atproto-labs/did-resolver": "0.1.4",
|
31
|
+
"@atproto-labs/fetch": "0.1.1",
|
32
32
|
"@atproto-labs/handle-resolver": "0.1.3",
|
33
|
-
"@atproto-labs/identity-resolver": "0.1.
|
33
|
+
"@atproto-labs/identity-resolver": "0.1.4",
|
34
34
|
"@atproto-labs/simple-store": "0.1.1",
|
35
35
|
"@atproto-labs/simple-store-memory": "0.1.1",
|
36
36
|
"@atproto/did": "0.1.2",
|
37
37
|
"@atproto/jwk": "0.1.1",
|
38
|
-
"@atproto/oauth-types": "0.1.
|
39
|
-
"@atproto/xrpc": "0.6.
|
38
|
+
"@atproto/oauth-types": "0.1.5",
|
39
|
+
"@atproto/xrpc": "0.6.3"
|
40
40
|
},
|
41
41
|
"devDependencies": {
|
42
42
|
"typescript": "^5.3.3"
|
package/src/oauth-client.ts
CHANGED
@@ -285,15 +285,11 @@ export class OAuthClient extends CustomEventTarget<OAuthClientEventMap> {
|
|
285
285
|
? input // If input is a handle or a DID, use it as a login_hint
|
286
286
|
: undefined,
|
287
287
|
response_mode: this.responseMode,
|
288
|
-
response_type:
|
289
|
-
// Negotiate by using the order in the client metadata
|
290
|
-
this.clientMetadata.response_types?.find((t) =>
|
291
|
-
metadata['response_types_supported']?.includes(t),
|
292
|
-
) ?? 'code',
|
288
|
+
response_type: 'code',
|
293
289
|
|
294
290
|
display: options?.display,
|
295
291
|
prompt: options?.prompt,
|
296
|
-
scope: options?.scope
|
292
|
+
scope: options?.scope ?? this.clientMetadata.scope,
|
297
293
|
ui_locales: options?.ui_locales,
|
298
294
|
}
|
299
295
|
|
@@ -4,7 +4,7 @@ import { Key, Keyset } from '@atproto/jwk'
|
|
4
4
|
import {
|
5
5
|
CLIENT_ASSERTION_TYPE_JWT_BEARER,
|
6
6
|
OAuthAuthorizationServerMetadata,
|
7
|
-
|
7
|
+
OAuthClientCredentials,
|
8
8
|
OAuthEndpointName,
|
9
9
|
OAuthParResponse,
|
10
10
|
OAuthTokenResponse,
|
@@ -211,7 +211,7 @@ export class OAuthServerAgent {
|
|
211
211
|
|
212
212
|
async buildClientAuth(endpoint: OAuthEndpointName): Promise<{
|
213
213
|
headers?: Record<string, string>
|
214
|
-
payload:
|
214
|
+
payload: OAuthClientCredentials
|
215
215
|
}> {
|
216
216
|
const methodSupported =
|
217
217
|
this.serverMetadata[`token_endpoint_auth_methods_supported`]
|
@@ -1,5 +1,9 @@
|
|
1
1
|
import { Keyset } from '@atproto/jwk'
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
OAuthClientMetadataInput,
|
4
|
+
assertOAuthDiscoverableClientId,
|
5
|
+
assertOAuthLoopbackClientId,
|
6
|
+
} from '@atproto/oauth-types'
|
3
7
|
|
4
8
|
import { ClientMetadata, clientMetadataSchema } from './types.js'
|
5
9
|
|
@@ -30,11 +34,24 @@ export function validateClientMetadata(
|
|
30
34
|
|
31
35
|
const metadata = clientMetadataSchema.parse(input)
|
32
36
|
|
33
|
-
//
|
34
|
-
|
35
|
-
|
36
|
-
}
|
37
|
-
|
37
|
+
// Validate client ID
|
38
|
+
if (metadata.client_id.startsWith('http:')) {
|
39
|
+
assertOAuthLoopbackClientId(metadata.client_id)
|
40
|
+
} else {
|
41
|
+
assertOAuthDiscoverableClientId(metadata.client_id)
|
42
|
+
}
|
43
|
+
|
44
|
+
const scopes = metadata.scope?.split(' ')
|
45
|
+
if (!scopes?.includes('atproto')) {
|
46
|
+
throw new TypeError(`Client metadata must include the "atproto" scope`)
|
47
|
+
}
|
48
|
+
|
49
|
+
if (!metadata.response_types.includes('code')) {
|
50
|
+
throw new TypeError(`"response_types" must include "code"`)
|
51
|
+
}
|
52
|
+
|
53
|
+
if (!metadata.grant_types.includes('authorization_code')) {
|
54
|
+
throw new TypeError(`"grant_types" must include "authorization_code"`)
|
38
55
|
}
|
39
56
|
|
40
57
|
const method = metadata[TOKEN_ENDPOINT_AUTH_METHOD]
|