Skip to content

Commit e4a3ee6

Browse files
feat: make oidc issuer configurable
1 parent 768531c commit e4a3ee6

4 files changed

Lines changed: 20 additions & 3 deletions

File tree

‎.env.example‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ NEXT_PUBLIC_MANIFEST_RESOURCE_URI="resource.ttl"
1111
# Admin WebID used for booting the demo (replace with your WebID)
1212
NEXT_PUBLIC_ADMIN_WEBID="https://id.inrupt.com/your-webid"
1313

14+
# OIDC issuer URL for authentication
15+
# Default Inrupt provider, can be changed to other Solid-compatible providers
16+
NEXT_PUBLIC_OIDC_ISSUER="https://login.inrupt.com"
17+
1418
# Notes:
1519
# - Never commit secrets. This file is safe to commit because it contains placeholders only.
1620
# - For private credentials (if any), keep them in `.env` or `.env.local` which are ignored by git.

‎README.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ Therefore, you need a [WebID](https://solid.github.io/webid-profile/) to correct
1111

1212
A WebID is a URL you control and can use to sign in to Solid Apps.
1313

14-
Before running the app, set the `NEXT_PUBLIC_ADMIN_WEBID` environment variable in `.env.local`.
14+
Before running the app, set the `NEXT_PUBLIC_ADMIN_WEBID` and `NEXT_PUBLIC_OIDC_ISSUER` environment variable in `.env.local`.
1515

1616
Environment variables
1717
---------------------
1818

19-
This project includes a `.env.example` file with the placeholders for environment variables used by the app (for example `NEXT_PUBLIC_BASE_URI`, `NEXT_PUBLIC_MANIFEST_RESOURCE_URI`, and `NEXT_PUBLIC_ADMIN_WEBID`).
19+
This project includes a `.env.example` file with the placeholders for environment variables used by the app:
20+
- `NEXT_PUBLIC_BASE_URI` - Base URI for the Solid server
21+
- `NEXT_PUBLIC_MANIFEST_RESOURCE_URI` - URI for the manifest resource
22+
- `NEXT_PUBLIC_ADMIN_WEBID` - WebID of the admin user
23+
- `NEXT_PUBLIC_OIDC_ISSUER` - OIDC issuer URL for authentication (e.g., `https://login.inrupt.com`)
2024

2125
Copy the example to a local env file and edit values before running the app
2226

‎src/Config.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,13 @@ export class Config {
3232

3333
return value;
3434
}
35+
36+
public static get oidcIssuer(): string {
37+
const value = process.env.NEXT_PUBLIC_OIDC_ISSUER;
38+
if (value === undefined) {
39+
throw new Error(`${errorTemplate}NEXT_PUBLIC_OIDC_ISSUER`);
40+
}
41+
42+
return value;
43+
}
3544
}

‎src/components/ui/ListEditor.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export function ListEditor() {
178178
console.log("unauthenticated");
179179

180180
await login({
181-
oidcIssuer: "https://login.inrupt.com", // TODO: config
181+
oidcIssuer: Config.oidcIssuer,
182182
clientName: "My application",
183183
});
184184
}

0 commit comments

Comments
 (0)