Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/create.dart
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,8 @@ Next steps:
cd $path${runFlutterCreate ? '' : '\n flutter create --project-name <name> . # generate platform folders\n flutter pub get'}
flutter run

Then update the Solid app registration (clientId, redirectUris, link) in
lib/app.dart and the constants in lib/constants/app.dart for your deployment.
Then update the Solid app registration (appClientId, appRedirectUris, appLink)
and the other constants in lib/constants/app.dart for your deployment.

On macOS/iOS, enable signing once in Xcode (Signing & Capabilities -> Team)
so the keychain-backed login can build. See the generated README for details.
Expand Down
11 changes: 6 additions & 5 deletions templates/solidui/README.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ flutter run
A few values were filled in with placeholders when this project was generated.
Update them for your own deployment:

- **Solid app registration** in `lib/app.dart` — the `clientId`,
`redirectUris` and `link` passed to `SolidLogin`. These identify your app to
the Solid server during login. **The `clientId` URL must actually resolve to
a Client Identifier Document (a `client-profile.jsonld`) that lists these
exact `redirectUris`.** Until you publish that document (and list your
- **Solid app registration** in `lib/constants/app.dart` — `appClientId`,
`appRedirectUris`, `appPostLogoutRedirectUris` and `appLink`, passed to
`SolidLogin` from `lib/app.dart`. These identify your app to the Solid server
during login. **The `appClientId` URL must actually resolve to a Client
Identifier Document (a `client-profile.jsonld`) that lists these exact
redirect URIs.** Until you publish that document (and list your
`{{orgName}}.{{schemeName}}://redirect` scheme in it), the identity provider has
no client to validate and the login page will not appear — this is the most
common reason a freshly generated app cannot reach the login screen. See the
Expand Down
27 changes: 9 additions & 18 deletions templates/solidui/lib/app.dart.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,17 @@ class App extends StatelessWidget {

// The application folder created on the user's POD.

appDirectory: '{{projectName}}',
appDirectory: appPodDirectory,

// TODO Update the following Solid app registration details to point at
// your own deployment. They identify your app to the Solid server
// during login, and the clientId MUST resolve to a client profile
// document that lists these exact redirectUris (see the solid/ folder).
// See https://solidproject.org for more information.
//
// Note: the custom redirect scheme drops underscores from the project
// name ('{{orgName}}.{{schemeName}}'), because a URI scheme may not
// contain underscores. Every other identifier keeps the project name.
// Solid app registration details. Update these in lib/constants/app.dart
// to point at your own deployment; the clientId there must resolve to a
// client profile document listing exactly these redirect URIs (see the
// solid/ folder). See https://solidproject.org for more information.

link: 'https://github.com/example/{{projectName}}',
clientId:
'https://solidcommunity.au/apps/{{projectName}}/client-profile.jsonld',
redirectUris: [
'https://solidcommunity.au/apps/{{projectName}}/redirect.html',
'{{orgName}}.{{schemeName}}://redirect',
'http://localhost:4400/redirect',
],
link: appLink,
clientId: appClientId,
redirectUris: appRedirectUris,
postLogoutRedirectUris: appPostLogoutRedirectUris,
child: appScaffold,
),
);
Expand Down
45 changes: 45 additions & 0 deletions templates/solidui/lib/constants/app.dart.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,51 @@ import 'package:solidui/solidui.dart'

const String appTitle = '{{appTitle}}';

// ── Solid app registration ───────────────────────────────────────────────────

/// Solid OIDC client registration for {{appName}}.
///
/// These values identify the app to the Solid server during login. They are
/// gathered here so you can update them in one place when you deploy to your
/// own infrastructure.
///
/// [appClientId] MUST resolve to a publicly hosted client profile document
/// (the template in the `solid/` folder) whose `redirect_uris` and
/// `post_logout_redirect_uris` list exactly the URIs below. If they do not
/// match, the identity provider will reject the login. See the `solid/README`
/// and https://solidproject.org for more information.
///
/// Note: the custom redirect scheme drops underscores from the project name
/// ('{{orgName}}.{{schemeName}}'), because a URI scheme may not contain
/// underscores. Every other identifier keeps the full project name.

const String appClientId =
'https://solidcommunity.au/apps/{{projectName}}/client-profile.jsonld';

/// One redirect URI per platform; SolidUI selects the right one at runtime
/// based on the current platform. Keep this list in step with the
/// `redirect_uris` in the hosted client profile document.

const List<String> appRedirectUris = [
'https://solidcommunity.au/apps/{{projectName}}/redirect.html',
'{{orgName}}.{{schemeName}}://redirect',
'http://localhost:4400/redirect',
];

/// Where the identity provider returns the user after logging out. By default
/// we reuse the login redirect URIs, mirroring the hosted client profile.

const List<String> appPostLogoutRedirectUris = appRedirectUris;

/// The application folder created on the user's POD to store {{appName}} data.

const String appPodDirectory = '{{projectName}}';

/// Homepage opened from the login page's info button. Point this at your own
/// project page or documentation.

const String appLink = 'https://github.com/example/{{projectName}}';

/// Shared upload configuration for every `SolidFile` view in {{appName}}.
///
/// Restricts the file picker (both the toolbar Upload button and the side
Expand Down
2 changes: 1 addition & 1 deletion templates/solidui/solid/README.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ curl -I https://solidcommunity.au/apps/{{projectName}}/client-profile.jsonld #
```

The `redirect_uris` in the published document must be byte-for-byte identical to
the `redirectUris` list in `lib/app.dart`, including the
the `appRedirectUris` list in `lib/constants/app.dart`, including the
`{{orgName}}.{{schemeName}}://redirect` custom scheme.
Loading