Skip to content

Commit

Permalink
chore: Update @inrupt/solid-client-authn to v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimvh committed Jan 12, 2024
1 parent 820d9b8 commit 19f9ef7
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 100 deletions.
3 changes: 1 addition & 2 deletions documentation/markdown/usage/client-credentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,10 @@ Once you have an Access token, you can use it for authenticated requests until i

```ts
import { buildAuthenticatedFetch } from '@inrupt/solid-client-authn-core';
import fetch from 'node-fetch';

// The DPoP key needs to be the same key as the one used in the previous step.
// The Access token is the one generated in the previous step.
const authFetch = await buildAuthenticatedFetch(fetch, accessToken, { dpopKey });
const authFetch = await buildAuthenticatedFetch(accessToken, { dpopKey });
// authFetch can now be used as a standard fetch function that will authenticate as your WebID.
// This request will do a simple GET for example.
const response = await authFetch('http://localhost:3000/private');
Expand Down
164 changes: 69 additions & 95 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@
"@antfu/eslint-config": "2.3.4",
"@commitlint/cli": "^17.7.2",
"@commitlint/config-conventional": "^17.7.0",
"@inrupt/solid-client-authn-core": "^1.17.3",
"@inrupt/solid-client-authn-node": "^1.17.3",
"@inrupt/solid-client-authn-core": "^2.0.0",
"@inrupt/solid-client-authn-node": "^2.0.0",
"@tsconfig/node18": "^18.2.2",
"@types/jest": "^29.5.5",
"@types/set-cookie-parser": "^2.4.4",
Expand Down
2 changes: 1 addition & 1 deletion test/integration/Identity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ describe.each(stores)('A Solid server with IDP using %s', (name, { config, teard
});

it('can use the generated access token to do an authenticated call.', async(): Promise<void> => {
const authFetch = await buildAuthenticatedFetch(fetch, accessToken!, { dpopKey });
const authFetch = await buildAuthenticatedFetch(accessToken!, { dpopKey });
let res = await fetch(container);
expect(res.status).toBe(401);
res = await authFetch(container);
Expand Down

0 comments on commit 19f9ef7

Please sign in to comment.