Skip to content

Commit 8fa3752

Browse files
committed
add graph insight oauth
Signed-off-by: Thomas Telleis <[email protected]>
1 parent 96f5bf1 commit 8fa3752

File tree

4 files changed

+100
-6
lines changed

4 files changed

+100
-6
lines changed

docs/deploy-and-configure/configuration/graphinsights/index.md

Lines changed: 96 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ tags:
99

1010
## Resource consideration
1111

12-
Please refer to [Graph Insights Sizing](../../../deploy-and-configure/requirements/graph-insights-sizing.md) for more information.
12+
Please refer to [Graph Insights Sizing](../../../deploy-and-configure/requirements/graph-insights-sizing.md) for more
13+
information.
1314

1415

1516
## Enable Graph Insights
@@ -56,7 +57,8 @@ The configuration mentioned below is rendered with those files, but you usually
5657

5758
For more details please have a look in the helm value file.
5859
Every configuration is documented there.
59-
Please refer to [Kubernetes deployments](../../../deploy-and-configure/installation/scenario-k8s-deployment/index.md) for more information.
60+
Please refer to [Kubernetes deployments](../../../deploy-and-configure/installation/scenario-k8s-deployment/index.md)
61+
for more information.
6062

6163

6264
### Activate and verify the installation
@@ -229,7 +231,7 @@ logging:
229231
```
230232

231233

232-
## OAuth configuration
234+
### OAuth configuration
233235

234236
Graph Insights requires authentication similar to Explore and Build (DataIntegration).
235237
There is the need for a client to authenticate in a browser and a second client to allow inter-component communication.
@@ -239,9 +241,97 @@ For convenience, by default we use the same clients as for the rest of the appli
239241
- Client for browser: cmem
240242
- Client for component communication: cmem-service-account
241243

242-
In case you want to have separate clients for production deployments, have a look at the end of this file.
244+
In case you want to have separate clients for production deployments, this chapter is for you.
243245

246+
#### Using separate OAuth clients for Graph Insights
244247

245-
## Using separate OAuth clients for Graph Insights
248+
In our **docker-orchestration** to enrol those other clients, please follow these steps:
246249

247-
TBD
250+
1.) take a look at `environments/default.env` and copy these variables to your `environments/config.env` file:
251+
252+
``` Makefile
253+
# This is the browser client:
254+
GRAPHINSIGHTS_OAUTH_CLIENT_ID=graph-insights
255+
# was this before:
256+
# GRAPHINSIGHTS_OAUTH_CLIENT_ID=${OAUTH_CLIENT_ID}
257+
258+
# This is the inter component client:
259+
GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_ID=graph-insights-service-account
260+
# change the credital depending on your client secret, default would be: 7Ctw7eZvTeFYdwwvwopy8OjuMUVPb8A9
261+
GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_SECRET=changeme
262+
```
263+
264+
2.) Replace this in `docker-compose.yml`:
265+
266+
``` yaml
267+
- "EXPLORE_CMEM_SERVICE_CLIENT=${CMEM_SERVICE_ACCOUNT_CLIENT_ID}"
268+
- "EXPLORE_CMEM_SERVICE_CLIENT_SECRET=${CMEM_SERVICE_ACCOUNT_CLIENT_SECRET}"
269+
# with:
270+
- "EXPLORE_CMEM_SERVICE_CLIENT=${GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_ID}"
271+
- "EXPLORE_CMEM_SERVICE_CLIENT_SECRET=${GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_SECRET}"
272+
```
273+
274+
3.) And also replace this in `extensions/docker-compose.graphinsights.yml`
275+
276+
``` yaml
277+
- "GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_ID=${CMEM_SERVICE_ACCOUNT_CLIENT_ID}"
278+
- "GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_SECRET=${CMEM_SERVICE_ACCOUNT_CLIENT_SECRET}"
279+
# with:
280+
- "GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_ID=${GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_ID}"
281+
- "GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_SECRET=${GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_SECRET}"
282+
```
283+
284+
285+
286+
In **helm deployments**, once you have the clients available all you have to do is change these lines in your value.yaml
287+
accordingly:
288+
289+
``` yaml
290+
global:
291+
# GraphInsights service account OAuth credentials (if using GraphInsights).
292+
# Can use the same credentials as CMEM or separate ones.
293+
graphinsightsClientId: graph-insights-service-account
294+
graphinsightsClientSecret: changeme # IMPORTANT: Change this to a secure value!
295+
296+
# OAuth client ID for GraphInsights frontend authentication.
297+
# Default: "graph-insights" (must exist in your Keycloak realm if GraphInsights is enabled).
298+
oauthClientIdGraphInsights: graph-insights
299+
```
300+
301+
#### Creating separate OAuth clients for Graph Insights
302+
303+
If you start Corporate Memory for the first time, the separate clients are already created when starting the
304+
Postgresql container.
305+
However, regenerating a new client secret is advisable:
306+
- Select the `eccenca Corporate Memory`-realm
307+
- Select `Clients`
308+
- Select the client `graph-insights-service-account`.
309+
- Select the tab `Credentials`
310+
- Press `Regenerate`
311+
- Then copy the new secret and fill in the values from above.
312+
![Keycloak client secret regenerate](keycloak-client-secret-regenerate.png)
313+
314+
Also have a look below and check if your
315+
[Backchannel logout URL](/deploy-and-configure/configuration/graphinsights/#set-backchannel-logout-url-for-graph-insights) is set.
316+
317+
In an already running deployment you would have to create those clients on your own.
318+
319+
We assume the we name the clients as following:
320+
- Browser client: `graph-insights`
321+
- Inter-component client: `graph-insights-service-account`
322+
323+
#### Set Backchannel logout URL for Graph Insights
324+
325+
You would follow the same steps as in
326+
[Keycloak Client configuration](../../../deploy-and-configure/configuration/keycloak/index.md) but name them
327+
differently, e.g. as above.
328+
In addition, on last step is missing: To have the logout working properly you have to add a client Backchannel logout
329+
URL for the client ment for browser authentication (`graph-insights`):
330+
- Select the `eccenca Corporate Memory`-realm
331+
- Select `Clients`
332+
- Select the client `graph-insights`.
333+
- Scroll down to this section and add this: `https://<your-deploy-host>/graphinsights/logout/connect/back-channel/keycloak`
334+
335+
![Keycloak backchannel LogExplore select_graphinsights](keycloak-client-backchannel.png)
336+
337+
Thats all, you are all set.
113 KB
Loading
98.6 KB
Loading

docs/deploy-and-configure/installation/scenario-k8s-deployment/images/.$cmem-helm-architecture.svg.bkp

Lines changed: 4 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)