From b2928e2edf6b86820509b93af80d1f35670cfde0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Feb 2026 18:23:11 +0000 Subject: [PATCH 1/3] Initial plan From 81c610dcdb0f09f8ba6bd879921ad70bf6a85e8d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Feb 2026 18:25:01 +0000 Subject: [PATCH 2/3] fix: add optional SOLID_RESOURCE_URL env var for the resource to fetch Co-authored-by: jeswr <63333554+jeswr@users.noreply.github.com> --- docs/guides/authenticating_with_a_script.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/guides/authenticating_with_a_script.md b/docs/guides/authenticating_with_a_script.md index a55e2cf..0ef536c 100644 --- a/docs/guides/authenticating_with_a_script.md +++ b/docs/guides/authenticating_with_a_script.md @@ -73,6 +73,7 @@ import { Session } from '@inrupt/solid-client-authn-node'; const CLIENT_ID = process.env.SOLID_CLIENT_ID; const CLIENT_SECRET = process.env.SOLID_CLIENT_SECRET; const OIDC_ISSUER = process.env.SOLID_OIDC_ISSUER; // Your authorization server URL (sometimes called IdP, sometimes same as your Solid server URL) +const RESOURCE_URL = process.env.SOLID_RESOURCE_URL; // URL of the protected resource to fetch (optional) async function main() { // Create a new session and log in @@ -90,8 +91,9 @@ async function main() { // session.fetch works just like the standard fetch API, // but automatically includes authentication headers. - const response = await session.fetch(session.info.webId); - console.log(`GET ${session.info.webId} — ${response.status}`); + const resourceUrl = RESOURCE_URL ?? session.info.webId; + const response = await session.fetch(resourceUrl); + console.log(`GET ${resourceUrl} — ${response.status}`); console.log(await response.text()); // Always log out when done @@ -102,7 +104,7 @@ async function main() { main().catch(console.error); ``` -Run the script, passing your credentials and authorization server URL (sometimes same as Solid server URL) as environment variables. +Run the script, passing your credentials, authorization server URL (sometimes same as Solid server URL), and optionally the URL of the protected resource you want to fetch as environment variables. On **Linux / macOS** (Bash): @@ -110,6 +112,7 @@ On **Linux / macOS** (Bash): SOLID_CLIENT_ID="your-client-id" \ SOLID_CLIENT_SECRET="your-client-secret" \ SOLID_OIDC_ISSUER="http://localhost:3000" \ +SOLID_RESOURCE_URL="https://example.solidcommunity.net/your-pod/private-resource" \ node index.js ``` @@ -119,12 +122,13 @@ On **Windows** (PowerShell): $env:SOLID_CLIENT_ID="your-client-id" $env:SOLID_CLIENT_SECRET="your-client-secret" $env:SOLID_OIDC_ISSUER="http://localhost:3000" +$env:SOLID_RESOURCE_URL="https://example.solidcommunity.net/your-pod/private-resource" node index.js ``` -Replace `http://localhost:3000` with the URL of your Solid server (for example, `https://solidcommunity.net` or `https://login.inrupt.com`). +Replace `http://localhost:3000` with the URL of your authorization server (for example, `https://solidcommunity.net` or `https://login.inrupt.com`), and set `SOLID_RESOURCE_URL` to the URL of the private resource you want to access. If `SOLID_RESOURCE_URL` is omitted, the script falls back to fetching your WebID profile document. -You should see your profile document printed to the console. +You should see the contents of the resource printed to the console. ## Tips From 0ceb69ed897775d57193f8e79885092f7d7e6073 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Sat, 21 Feb 2026 21:48:32 +0000 Subject: [PATCH 3/3] Apply suggestions from code review --- docs/guides/authenticating_with_a_script.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/authenticating_with_a_script.md b/docs/guides/authenticating_with_a_script.md index 0ef536c..d8c0017 100644 --- a/docs/guides/authenticating_with_a_script.md +++ b/docs/guides/authenticating_with_a_script.md @@ -112,7 +112,7 @@ On **Linux / macOS** (Bash): SOLID_CLIENT_ID="your-client-id" \ SOLID_CLIENT_SECRET="your-client-secret" \ SOLID_OIDC_ISSUER="http://localhost:3000" \ -SOLID_RESOURCE_URL="https://example.solidcommunity.net/your-pod/private-resource" \ +SOLID_RESOURCE_URL="http://localhost:3000/your-pod/private-resource" \ node index.js ``` @@ -122,7 +122,7 @@ On **Windows** (PowerShell): $env:SOLID_CLIENT_ID="your-client-id" $env:SOLID_CLIENT_SECRET="your-client-secret" $env:SOLID_OIDC_ISSUER="http://localhost:3000" -$env:SOLID_RESOURCE_URL="https://example.solidcommunity.net/your-pod/private-resource" +$env:SOLID_RESOURCE_URL="http://localhost:3000/your-pod/private-resource" node index.js ```