From 9738c719958f9e02e86127f00d170c19da149585 Mon Sep 17 00:00:00 2001 From: Tony Chen Date: Tue, 7 Jul 2026 14:12:10 +1000 Subject: [PATCH 1/5] Fix the oidc login issue --- client-profile.jsonld | 25 +++++++++ lib/app.dart | 2 +- support/flutter.mk | 2 +- web/redirect.html | 122 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 client-profile.jsonld create mode 100644 web/redirect.html diff --git a/client-profile.jsonld b/client-profile.jsonld new file mode 100644 index 0000000..815d336 --- /dev/null +++ b/client-profile.jsonld @@ -0,0 +1,25 @@ +{ + "@context": "https://www.w3.org/ns/solid/oidc-context.jsonld", + "client_id": "https://solidcommunity.au/apps/geopod/client-profile.jsonld", + "client_name": "GeoPod", + "application_type": "native", + "redirect_uris": [ + "https://geopod.solidcommunity.au/redirect.html", + "com.togaware.geopod://redirect", + "http://localhost:4400/redirect" + ], + "post_logout_redirect_uris": [ + "https://geopod.solidcommunity.au/redirect.html", + "com.togaware.geopod://redirect", + "http://localhost:4400/redirect" + ], + "scope": "openid profile offline_access webid", + "grant_types": [ + "authorization_code", + "refresh_token" + ], + "response_types": [ + "code" + ], + "token_endpoint_auth_method": "none" +} diff --git a/lib/app.dart b/lib/app.dart index 9fcffa1..56439f2 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -72,7 +72,7 @@ class App extends StatelessWidget { ], clientId: 'https://solidcommunity.au/apps/geopod/client-profile.jsonld', redirectUris: [ - 'https://solidcommunity.au/apps/geopod/redirect.html', + 'https://geopod.solidcommunity.au/redirect.html', 'com.togaware.geopod://redirect', 'http://localhost:4400/redirect', ], diff --git a/support/flutter.mk b/support/flutter.mk index 3656594..8ecda07 100644 --- a/support/flutter.mk +++ b/support/flutter.mk @@ -102,7 +102,7 @@ LOC := $(shell if [ -f support/loc.sh ]; then echo support/loc.sh; \ .PHONY: chrome chrome: - flutter run -d chrome --release + flutter run -d chrome --release --web-port=4400 # 20220503 gjw The following fails if the target files already exist - # just needs to be run once. diff --git a/web/redirect.html b/web/redirect.html new file mode 100644 index 0000000..3d64b43 --- /dev/null +++ b/web/redirect.html @@ -0,0 +1,122 @@ + + + + + + + Flutter Oidc Redirect + + + + + +

Authentication completed! Please close this page.

+ + + From 02ac1004d3ee87fb2f86c7617bbc71122e7510b3 Mon Sep 17 00:00:00 2001 From: Tony Chen Date: Wed, 8 Jul 2026 02:53:55 +1000 Subject: [PATCH 2/5] Move client-profile.jsonld to web directory --- lib/app.dart | 4 +- web/callback.html | 39 ------------------- .../client-profile.jsonld | 8 ++-- 3 files changed, 7 insertions(+), 44 deletions(-) delete mode 100644 web/callback.html rename client-profile.jsonld => web/client-profile.jsonld (71%) diff --git a/lib/app.dart b/lib/app.dart index 56439f2..444ec88 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -70,11 +70,11 @@ class App extends StatelessWidget { 'encrypted_data', 'places', ], - clientId: 'https://solidcommunity.au/apps/geopod/client-profile.jsonld', + clientId: 'https://geopod.solidcommunity.au/client-profile.jsonld', redirectUris: [ 'https://geopod.solidcommunity.au/redirect.html', 'com.togaware.geopod://redirect', - 'http://localhost:4400/redirect', + 'http://localhost:4400/redirect.html', ], child: appWithPreload, ); diff --git a/web/callback.html b/web/callback.html deleted file mode 100644 index b6dbc8f..0000000 --- a/web/callback.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Authentication Callback - - - -

Authentication complete. You can close this window.

-

If this window does not close automatically, please close it manually.

- - - - diff --git a/client-profile.jsonld b/web/client-profile.jsonld similarity index 71% rename from client-profile.jsonld rename to web/client-profile.jsonld index 815d336..9eed20a 100644 --- a/client-profile.jsonld +++ b/web/client-profile.jsonld @@ -1,17 +1,19 @@ { "@context": "https://www.w3.org/ns/solid/oidc-context.jsonld", - "client_id": "https://solidcommunity.au/apps/geopod/client-profile.jsonld", + "client_id": "https://geopod.solidcommunity.au/client-profile.jsonld", "client_name": "GeoPod", "application_type": "native", "redirect_uris": [ "https://geopod.solidcommunity.au/redirect.html", "com.togaware.geopod://redirect", - "http://localhost:4400/redirect" + "http://localhost:4400/redirect", + "http://localhost:4400/redirect.html" ], "post_logout_redirect_uris": [ "https://geopod.solidcommunity.au/redirect.html", "com.togaware.geopod://redirect", - "http://localhost:4400/redirect" + "http://localhost:4400/redirect", + "http://localhost:4400/redirect.html" ], "scope": "openid profile offline_access webid", "grant_types": [ From 44b35fba64e4e90c1bc365300109e3f2a5d1ffeb Mon Sep 17 00:00:00 2001 From: Tony Chen Date: Fri, 10 Jul 2026 01:34:48 +1000 Subject: [PATCH 3/5] Move client-profile.jsonld to root directory, and add entitlements files --- ...nt-profile.jsonld => client-profile.jsonld | 4 +--- lib/app.dart | 21 +++++++++++++------ macos/Runner/DebugProfile.entitlements | 2 ++ macos/Runner/Release.entitlements | 6 ++++++ 4 files changed, 24 insertions(+), 9 deletions(-) rename web/client-profile.jsonld => client-profile.jsonld (81%) diff --git a/web/client-profile.jsonld b/client-profile.jsonld similarity index 81% rename from web/client-profile.jsonld rename to client-profile.jsonld index 9eed20a..0e0b823 100644 --- a/web/client-profile.jsonld +++ b/client-profile.jsonld @@ -1,18 +1,16 @@ { "@context": "https://www.w3.org/ns/solid/oidc-context.jsonld", - "client_id": "https://geopod.solidcommunity.au/client-profile.jsonld", + "client_id": "https://dev.empwr.au/geopod/client-profile.jsonld", "client_name": "GeoPod", "application_type": "native", "redirect_uris": [ "https://geopod.solidcommunity.au/redirect.html", "com.togaware.geopod://redirect", - "http://localhost:4400/redirect", "http://localhost:4400/redirect.html" ], "post_logout_redirect_uris": [ "https://geopod.solidcommunity.au/redirect.html", "com.togaware.geopod://redirect", - "http://localhost:4400/redirect", "http://localhost:4400/redirect.html" ], "scope": "openid profile offline_access webid", diff --git a/lib/app.dart b/lib/app.dart index 444ec88..a9d7cfd 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -27,6 +27,7 @@ library; import 'dart:async'; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/material.dart'; import 'package:solidpod/solidpod.dart' show registerLogoutCacheCallback; @@ -70,12 +71,20 @@ class App extends StatelessWidget { 'encrypted_data', 'places', ], - clientId: 'https://geopod.solidcommunity.au/client-profile.jsonld', - redirectUris: [ - 'https://geopod.solidcommunity.au/redirect.html', - 'com.togaware.geopod://redirect', - 'http://localhost:4400/redirect.html', - ], + clientId: 'https://dev.empwr.au/geopod/client-profile.jsonld', + // On web the redirect must be same-origin as where the app is served, + // otherwise redirect.html's BroadcastChannel cannot hand the auth + // response back and login hangs on the spinner. solidpod's + // pickRedirectUri simply takes the first https:// entry (it does not + // match on origin), so we derive the web entry from Uri.base.origin: + // the deployed https host in production, and http://localhost:4400 + // under `flutter run -d chrome --web-port=4400`. + redirectUris: kIsWeb + ? ['${Uri.base.origin}/redirect.html'] + : const [ + 'com.togaware.geopod://redirect', + 'http://localhost:4400/redirect.html', + ], child: appWithPreload, ); diff --git a/macos/Runner/DebugProfile.entitlements b/macos/Runner/DebugProfile.entitlements index 159e5ed..8b491c7 100644 --- a/macos/Runner/DebugProfile.entitlements +++ b/macos/Runner/DebugProfile.entitlements @@ -17,5 +17,7 @@ --> keychain-access-groups + com.apple.security.keychain + diff --git a/macos/Runner/Release.entitlements b/macos/Runner/Release.entitlements index 64cabb4..1912118 100644 --- a/macos/Runner/Release.entitlements +++ b/macos/Runner/Release.entitlements @@ -4,9 +4,15 @@ com.apple.security.app-sandbox + com.apple.security.cs.allow-jit + com.apple.security.network.server com.apple.security.network.client + keychain-access-groups + + com.apple.security.keychain + From 630e151073d65479e9867cd39a60e112a0e32e9f Mon Sep 17 00:00:00 2001 From: Tony Chen Date: Fri, 10 Jul 2026 01:40:58 +1000 Subject: [PATCH 4/5] Fix the black screen issue on macOS --- .lycheeignore | 1 + macos/Runner/DebugProfile.entitlements | 7 +------ pubspec.yaml | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.lycheeignore b/.lycheeignore index 76d4fe3..2821f58 100644 --- a/.lycheeignore +++ b/.lycheeignore @@ -15,6 +15,7 @@ https://your-domain/redirect.html # Localhost used in comments http://localhost:3000/ +http://localhost:4400/ # POD OAuth endpoints that require authentication parameters diff --git a/macos/Runner/DebugProfile.entitlements b/macos/Runner/DebugProfile.entitlements index 8b491c7..1912118 100644 --- a/macos/Runner/DebugProfile.entitlements +++ b/macos/Runner/DebugProfile.entitlements @@ -10,13 +10,8 @@ com.apple.security.network.client - - keychain-access-groups - + com.apple.security.keychain diff --git a/pubspec.yaml b/pubspec.yaml index d7cf3be..38a2a32 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,6 +32,7 @@ dependencies: intl: ^0.20.1 latlong2: ^0.9.1 markdown_tooltip: ^0.0.10 + media_kit_libs_video: ^1.0.5 path_provider: ^2.1.5 pdf: ^3.11.1 shared_preferences: ^2.3.3 From 4f240f5d5669334b3a865dd8efa8bad3b4d5dfd8 Mon Sep 17 00:00:00 2001 From: Tony Chen Date: Fri, 10 Jul 2026 01:43:09 +1000 Subject: [PATCH 5/5] Revert the clientIds --- client-profile.jsonld | 2 +- lib/app.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client-profile.jsonld b/client-profile.jsonld index 0e0b823..8b017b7 100644 --- a/client-profile.jsonld +++ b/client-profile.jsonld @@ -1,6 +1,6 @@ { "@context": "https://www.w3.org/ns/solid/oidc-context.jsonld", - "client_id": "https://dev.empwr.au/geopod/client-profile.jsonld", + "client_id": "https://gjwgit.github.io/geopod/client-profile.jsonld", "client_name": "GeoPod", "application_type": "native", "redirect_uris": [ diff --git a/lib/app.dart b/lib/app.dart index a9d7cfd..59547e3 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -71,7 +71,7 @@ class App extends StatelessWidget { 'encrypted_data', 'places', ], - clientId: 'https://dev.empwr.au/geopod/client-profile.jsonld', + clientId: 'https://gjwgit.github.io/geopod/client-profile.jsonld', // On web the redirect must be same-origin as where the app is served, // otherwise redirect.html's BroadcastChannel cannot hand the auth // response back and login hangs on the spinner. solidpod's