Skip to content

Commit 23adeec

Browse files
Copilotjeswr
andauthored
feat: add guide for authenticating with a script (#15)
* Initial plan * Address review feedback: load OIDC_ISSUER from env var, add cross-platform instructions Co-authored-by: jeswr <63333554+jeswr@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jeswr <63333554+jeswr@users.noreply.github.com>
1 parent a3af9a0 commit 23adeec

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

docs/guides/authenticating_with_a_script.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ import { Session } from '@inrupt/solid-client-authn-node';
7272
// In production, load these from environment variables.
7373
const CLIENT_ID = process.env.SOLID_CLIENT_ID;
7474
const CLIENT_SECRET = process.env.SOLID_CLIENT_SECRET;
75-
const OIDC_ISSUER = 'http://localhost:3000'; // Your Solid server URL
75+
const OIDC_ISSUER = process.env.SOLID_OIDC_ISSUER; // Your Solid server URL
7676

7777
async function main() {
7878
// Create a new session and log in
@@ -102,14 +102,28 @@ async function main() {
102102
main().catch(console.error);
103103
```
104104

105-
Run the script:
105+
Run the script, passing your credentials and server URL as environment variables.
106+
107+
On **Linux / macOS** (Bash):
106108

107109
```bash
108110
SOLID_CLIENT_ID="your-client-id" \
109111
SOLID_CLIENT_SECRET="your-client-secret" \
112+
SOLID_OIDC_ISSUER="http://localhost:3000" \
113+
node index.js
114+
```
115+
116+
On **Windows** (PowerShell):
117+
118+
```powershell
119+
$env:SOLID_CLIENT_ID="your-client-id"
120+
$env:SOLID_CLIENT_SECRET="your-client-secret"
121+
$env:SOLID_OIDC_ISSUER="http://localhost:3000"
110122
node index.js
111123
```
112124

125+
Replace `http://localhost:3000` with the URL of your Solid server (for example, `https://solidcommunity.net` or `https://login.inrupt.com`).
126+
113127
You should see your profile document printed to the console.
114128

115129
## Tips

0 commit comments

Comments
 (0)