File tree Expand file tree Collapse file tree 6 files changed +21
-4
lines changed
Expand file tree Collapse file tree 6 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ The frontend is meant to connect to either the Tornjak backend or the Tornjak ma
5757| ` NODE_OPTIONS ` | Node options for npm start | ` --openssl-legacy-provider ` | ` --openssl-legacy-provider ` | false |
5858| ` REACT_APP_TORNJAK_MANAGER ` | Boolean for whether the connected server is a manager | ` false ` | ` true ` | false |
5959| ` REACT_APP_AUTH_SERVER_URI ` | URI for the Keycloak instance to obtain access tokens | | ` http://localhost:8080 ` | false |
60+ | ` REACT_APP_KEYCLOAK_REALM ` | Name of Keycloak realm | | 'tornjak' | false |
61+ | ` REACT_APP_OIDC_CLIENT_ID ` | Auth Client ID | | 'tornjak' | false |
6062| ` PORT_FE ` | Port for the frontend to run | ` 3000 ` | ` 3000 ` | true |
6163| ` PORT_BE ` | Port for the backend to run | ` 10000 ` | ` 10000 ` | true |
6264| ` REACT_APP_SPIRE_HEALTH_CHECK_ENABLE ` | Enable SPIRE health check component | ` false ` | ` true ` | false |
Original file line number Diff line number Diff line change @@ -59,18 +59,27 @@ with more details on the general configuration
59591 . ** Configure Tornjak Frontend**
6060Finally, the Frontend must be deployed and configured to obtain access tokens from this auth server.
6161This can be done locally with the environment variable
62- ` REACT_APP_AUTH_SERVER_URI ` :
62+ ` REACT_APP_AUTH_SERVER_URI ` . In addition ` REACT_APP_KEYCLOAK_REALM ` and ` REACT_APP_OIDC_CLIENT_ID ` must be set as well.
63+
64+ Default values are:
65+
66+ ` REACT_APP_KEYCLOAK_REALM ` - 'tornjak'
67+
68+ ` REACT_APP_OIDC_CLIENT_ID ` - 'tornjak'
6369
6470```
6571cd tornjak-frontend
6672REACT_APP_API_SERVER_URI=http://localhost:10000/
73+ REACT_APP_KEYCLOAK_REALM=tornjak
74+ REACT_APP_OIDC_CLIENT_ID=tornjak
6775REACT_APP_AUTH_SERVER_URI=http://localhost:8080/ npm start
6876```
6977
7078Alternatively, we can do the same on the containerized version:
7179
7280```
73- docker run -p 3000:3000 -d -e REACT_APP_API_SERVER_URI='http://localhost:10000' -e REACT_APP_AUTH_SERVER_URI='http://localhost:8080' ghcr.io/spiffe/tornjak-frontend:v1.5.0
81+ docker run -p 3000:3000 -d -e REACT_APP_API_SERVER_URI='http://localhost:10000' -e REACT_APP_AUTH_SERVER_URI='http://localhost:8080' -e REACT_APP_KEYCLOAK_REALM='tornjak' -e
82+ REACT_APP_OIDC_CLIENT_ID='tornjak' ghcr.io/spiffe/tornjak-frontend:v1.5.0
7483`
7584```
7685
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ REACT_APP_API_SERVER_URI=http://localhost:10000/
1111
1212# #### For user management #####
1313# REACT_APP_AUTH_SERVER_URI=http://localhost:8080/
14+ REACT_APP_KEYCLOAK_REALM = " tornjak"
15+ REACT_APP_OIDC_CLIENT_ID = " tornjak"
1416
1517
1618# #### To check SPIRE health #####
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ REACT_APP_API_SERVER_URI=http://localhost:10000/
55
66# #### For user management #####
77# REACT_APP_AUTH_SERVER_URI=http://localhost:8080/
8+ REACT_APP_KEYCLOAK_REALM = " tornjak"
9+ REACT_APP_OIDC_CLIENT_ID = " tornjak"
810
911
1012# #### To check SPIRE health #####
Original file line number Diff line number Diff line change 11import Keycloak from "keycloak-js" ;
22import { env } from '../env' ;
33const keycloakConfig = {
4- "realm" : "tornjak" ,
4+ "realm" : env . REACT_APP_KEYCLOAK_REALM ,
55 "url" : env . REACT_APP_AUTH_SERVER_URI ,
66 "ssl-required" : "external" ,
7- "clientId" : "Tornjak-React-auth" ,
7+ "clientId" : env . REACT_APP_OIDC_CLIENT_ID ,
88 "public-client" : true ,
99 "verify-token-audience" : true ,
1010 "use-resource-role-mappings" : true ,
Original file line number Diff line number Diff line change @@ -8,5 +8,7 @@ declare global {
88 REACT_APP_AUTH_SERVER_URI : string ,
99 REACT_APP_API_SERVER_URI : string ,
1010 REACT_APP_TORNJAK_MANAGER : string ,
11+ REACT_APP_KEYCLOAK_REALM : string ,
12+ REACT_APP_OIDC_CLIENT_ID : string ,
1113 }
1214 export const env : EnvType = { ...process . env , ...window . env }
You can’t perform that action at this time.
0 commit comments