From 145395f9a4cf58e7a2f5791d7c987b0148371773 Mon Sep 17 00:00:00 2001 From: James Futhey Date: Tue, 17 Dec 2024 10:25:36 +0900 Subject: [PATCH] Update README.md Improve code examples (some OAuth implementation details are missing in these examples) --- packages/oauth/oauth-client-node/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/oauth/oauth-client-node/README.md b/packages/oauth/oauth-client-node/README.md index 6ec7073f3a8..572da02f75f 100644 --- a/packages/oauth/oauth-client-node/README.md +++ b/packages/oauth/oauth-client-node/README.md @@ -38,9 +38,11 @@ const client = new NodeOAuthClient({ policy_uri: 'https://my-app.com/policy', redirect_uris: ['https://my-app.com/callback'], grant_types: ['authorization_code', 'refresh_token'], + scope: 'atproto transition:generic', response_types: ['code'], application_type: 'web', token_endpoint_auth_method: 'private_key_jwt', + token_endpoint_auth_signing_alg: 'RS256', dpop_bound_access_tokens: true, jwks_uri: 'https://my-app.com/jwks.json', }, @@ -48,9 +50,9 @@ const client = new NodeOAuthClient({ // Used to authenticate the client to the token endpoint. Will be used to // build the jwks object to be exposed on the "jwks_uri" endpoint. keyset: await Promise.all([ - JoseKey.fromImportable(process.env.PRIVATE_KEY_1), - JoseKey.fromImportable(process.env.PRIVATE_KEY_2), - JoseKey.fromImportable(process.env.PRIVATE_KEY_3), + JoseKey.fromImportable(process.env.PRIVATE_KEY_1, 'key1'), + JoseKey.fromImportable(process.env.PRIVATE_KEY_2, 'key2'), + JoseKey.fromImportable(process.env.PRIVATE_KEY_3, 'key3'), ]), // Interface to store authorization state data (during authorization flows)