diff --git a/README.md b/README.md index 9e28253..0bb362c 100644 --- a/README.md +++ b/README.md @@ -97,10 +97,6 @@ This will install the client app's dependencies. You can setup and use your own OpenID Connect server; if you do so, you also have to update the config files `bbconf/broker-config.toml` and `bbconf/dbroxy-config.toml` accordingly. -If you just want to try things out, you are welcome to use our development Keycloak server. The config files are already setup to use it. There is a test user named `tester`, the password is `rantanplan`. - -We have an extra page in our documentation dedicated to [Authorization](https://docs.basebox.io/guide/authorization/). - ## Run ### Start dbproxy diff --git a/src/util/oidc.js b/src/util/oidc.js index 0dd56dd..a5f9763 100644 --- a/src/util/oidc.js +++ b/src/util/oidc.js @@ -9,14 +9,17 @@ import { Log, UserManager, WebStorageStateStore } from 'oidc-client-ts'; Log.logger = console; -Log.level = (process.env.NODE_ENV === 'production') ? Log.ERROR : Log.DEBUG; +Log.level = (import.meta.env.PROD) ? Log.ERROR : Log.DEBUG; -/* OpenID Connect Config */ -const oidcProviderDomain = 'https://basebox-test-1.eu.auth0.com'; -const clientId = '5wl8hQV1thh07rScSoJ3aN56ETuXWprg'; -const clientSecret = 'QlHMvIffKLRviCcSu_bPQcf8e4dc6WeS3BwZE1r1F-9R30AFoeYEwaOazAuFenI5'; -const scopes = "openid profile email name nickname"; -export const callbackPath = "/auth/callback" +/** + * OpenID Connect Config + * Fields can be overridden by environment variables. All variables start with a VITE_BB_OIDC_ prefix. + */ +const oidcProviderDomain = import.meta.env.VITE_BB_OIDC_DOMAIN || 'https://basebox-test-1.eu.auth0.com'; +const clientId = import.meta.env.VITE_BB_OIDC_CLIENT_ID || '5wl8hQV1thh07rScSoJ3aN56ETuXWprg'; +const clientSecret = import.meta.env.VITE_BB_OIDC_SECRET || 'QlHMvIffKLRviCcSu_bPQcf8e4dc6WeS3BwZE1r1F-9R30AFoeYEwaOazAuFenI5'; +const scopes = import.meta.env.VITE_BB_OIDC_SCOPES || "openid profile email name nickname"; +export const callbackPath = import.meta.env.VITE_BB_OIDC_CALLBACK_PATH || "/auth/callback" /* OIDC UserManager singleton */ let userMgr = null;