Skip to main content

Deploy browser apps with user sessions

Configure the Console and Investor portal when they run on separate hosts and keep session cookies on each app origin.

The Console and Investor portal can run on separate public hosts. Each browser app with a host-only session cookie serves the Platform API paths on its own origin and forwards them to the private Platform API service, so the session cookie reaches server-rendered pages.

The Investor portal forwards /api and /dalp using the SDK's createDalpProxy to DAPI_INTERNAL_URL (default http://dalp-api:3001). Custom browser apps built on the SDK mount the same handler (browser apps with user sessions).

Set each app's public URL separately: global.dalpApp.config.app.http.url for the Console and global.dalpApp.env.INVESTOR_PORTAL_URL for the Investor portal. Never set a public DAPI_URL for the browser: browsers call the app origin, and the server proxies internally.

The public URL also governs two HTTPS-only headers. When an app's public URL starts with http://, responses omit Strict-Transport-Security, and the Console and docs omit upgrade-insecure-requests from their Content Security Policy. Any https://, unset or unparseable URL keeps both headers.

Helm

The chart passes DAPI_INTERNAL_URL and TRUSTED_PROXY_PROFILE (from global.dalpApp.config.trustedProxy.profile) to the Investor portal, and applies the same proxy profile to the Console and the Platform API. The profile names the proxy in front of the browser apps, whose header carries each caller's address: envoy, nginx or openshift. A browser app is supported only behind such a proxy, because the Platform API counts sign-in attempts per caller address.

  • Left unset, the chart uses nginx when the Console is served through an Ingress.
  • It refuses to render, naming the value to set, when an HTTPRoute (envoy) or an OpenShift Route (openshift) serves the Console or a portal, or when the enabled edges disagree.
  • It refuses to render when a browser app has no proxy in front of it: no Ingress, HTTPRoute or OpenShift Route, or a Service type other than ClusterIP. If you run your own proxy in front, set the profile to match it.
  • It refuses to render when the Platform API's own Service type is not ClusterIP, unless the profile is set.
  • none refuses to render while the Console or a portal is deployed.
  • A trustedProxy block under one app's own config (for example dapp.config.trustedProxy) refuses to render. Set the profile once, in global.dalpApp.config.trustedProxy.profile.
  • An explicit envoy, nginx or openshift is kept as set.

Set the portal's public URL once in global.dalpApp.env.INVESTOR_PORTAL_URL. The chart passes it to the portal container and registers it as an allowed Portal origin in the Platform API:

global:
  dalpApp:
    env:
      INVESTOR_PORTAL_URL: "https://portal.example"
investorPortal:
  enabled: true

investorPortal.env defaults to PORT=3000 and DAPI_INTERNAL_URL=http://dalp-api:3001. Supplying your own env list replaces the default list wholesale, so keep both entries when overriding either.

See Investor portal for what investors see and how organisation theming applies.

INVESTOR_PORTAL_URL replaces CLIENT_PORTAL_URL. While INVESTOR_PORTAL_URL is empty, the portal still reads CLIENT_PORTAL_URL and logs CLIENT_PORTAL_URL is renamed INVESTOR_PORTAL_URL; the next release no longer reads the old name. Rename it before your next upgrade.

Give the Console and Investor portal separate routes when they use separate hosts. Forwarding preserves Set-Cookie, event streams and auth headers, and stamps the app's public origin on requests arriving without an Origin header. Each app forwards GET, HEAD, POST, PUT, PATCH, DELETE and OPTIONS. Any other method on /api returns HTTP 405 with code METHOD_NOT_ALLOWED, an Allow header and standard security headers.

A write is any method other than GET, HEAD or OPTIONS. When a write arrives without an Origin and the browser sends Sec-Fetch-Site: cross-site, the app stamps no origin. The Platform API rejects the write with HTTP 403 (Forbidden: Origin not allowed) before any operation runs, and also rejects any unlisted or null Origin.

Browsers treat console.example.com and portal.example.com as the same site under example.com, whereas hosts under shared public suffixes such as azurewebsites.net are separate sites. Pass both Origin and Sec-Fetch-Site through your ingress, gateway or CDN unchanged so this protection stays active.

OpenShift

Apply the OpenShift overlay and set a public Route host for each app. Keep DAPI_INTERNAL_URL private and set global.dalpApp.env.INVESTOR_PORTAL_URL to the public Portal host. No public Platform API Route is required for the Investor portal. See Deploy DALP to OpenShift for Route and NetworkPolicy checks.

Sign-in returns to login

If sign-in succeeds and immediately returns to the login page, the cookie was issued by another host. In the browser network panel, confirm sign-in posts to /api/auth/sign-in/email on the app host and that Set-Cookie names no public Platform API host. Remove DAPI_URL, confirm /api proxies through the app host, clear the old cookie and sign in again.

See Browser apps with user sessions for the handler example and forwarding rules.

Was this page helpful?