From 41986a7cef242cb1aaec39c7c1ef3e438bc7bcbd Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Wed, 9 Nov 2022 14:58:27 +0100 Subject: [PATCH] Expose Solid client id, Closes #123 --- solid-client-id.json | 14 ++++++++++++++ src/ldf-client-ui.js | 1 + webpack.config.js | 8 ++++++++ 3 files changed, 23 insertions(+) create mode 100644 solid-client-id.json diff --git a/solid-client-id.json b/solid-client-id.json new file mode 100644 index 00000000..466b7f9b --- /dev/null +++ b/solid-client-id.json @@ -0,0 +1,14 @@ +{ + "@context": ["https://www.w3.org/ns/solid/oidc-context.jsonld"], + "client_id": "https://query.linkeddatafragments.org/solid-client-id.json", + "client_name": "Comunica Web Client", + "redirect_uris": ["https://query.linkeddatafragments.org/"], + "post_logout_redirect_uris": ["https://query.linkeddatafragments.org/"], + "client_uri": "https://query.linkeddatafragments.org/", + "logo_uri" : "https://query.linkeddatafragments.org/images/logo.svg", + "scope" : "openid profile offline_access webid", + "grant_types" : ["refresh_token","authorization_code"], + "response_types" : ["code"], + "default_max_age" : 3600, + "require_auth_time" : true +} diff --git a/src/ldf-client-ui.js b/src/ldf-client-ui.js index e98872fe..67643a11 100644 --- a/src/ldf-client-ui.js +++ b/src/ldf-client-ui.js @@ -354,6 +354,7 @@ if (typeof global.process === 'undefined') oidcIssuer: $idp.val(), redirectUrl: window.location.href.replace('#', '?'), // OIDC does not allow hash fragments, so we encode it as query param clientName: 'Comunica Web Client', + clientId: 'https://query.linkeddatafragments.org/solid-client-id.json', }); } return false; diff --git a/webpack.config.js b/webpack.config.js index 4a94ffd4..c71e7272 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -31,6 +31,7 @@ module.exports = [ path.join(__dirname, './images/settings.svg'), path.join(__dirname, './images/sparql.png'), path.join(__dirname, './favicon.ico'), + path.join(__dirname, './solid-client-id.json'), path.join(process.cwd(), './queries.json'), ], output: { @@ -72,6 +73,13 @@ module.exports = [ { loader: require.resolve('file-loader'), options: { name: '[name].[ext]' } }, ], }, + { + type: 'javascript/auto', + test: /solid-client-id\.json$/, + use: [ + { loader: require.resolve('file-loader'), options: { name: '[name].[ext]' } }, + ], + }, { test: /\.(jpg|png|gif|svg|ico)$/, use: [