Setup
1. Register an app in Okta
- In the Okta Admin Console, go to Applications -> Applications -> Create App Integration.
- Choose OIDC - OpenID Connect as the sign-in method and Web Application as the application type.
- Set a Sign-in redirect URI of
https://thoras.yourcompany.com/oauth2/callback. - Under Assignments, grant access to the group(s) that should be able to reach the dashboard (or “Everyone” for org-wide access).
- Once created, note the Client ID and Client secret from the app’s
General tab, and your Okta domain (e.g.
dev-133337.okta.com) from the top of the Admin Console.
https://<your-okta-domain>/oauth2/default if you’re using
the default authorization server, or
https://<your-okta-domain>/oauth2/<auth-server-id> if you’ve configured a
custom authorization server under Security -> API.
See Okta’s own walkthrough of adding oauth2-proxy in front of an app:
Add Auth to Any App with OAuth2 Proxy.
2. Create the Kubernetes secret
oauth2-proxy needs three secrets, referenced viasecretKeyRef rather than
inlined in values.yaml:
Generate the cookie secret with:
kubectl
when using --from-literal):
3. Configure the oauth2-proxy sidecar in values.yaml
Add an extraContainers entry under thorasDashboard:
Key flags explained
Full flag reference: oauth2-proxy configuration options.--oidc-issuer-url— points to your Okta authorization server. Replace<your-okta-domain>with your Okta org’s domain. Use/oauth2/defaultfor the default authorization server, or/oauth2/<auth-server-id>if you’ve set up a custom one.--upstream— the dashboard’s local container port that oauth2-proxy proxies to after successful auth. This stays plain HTTP over loopback (127.0.0.1) because it’s a same-pod, container-to-container hop. TLS belongs on the external-facing side (--cookie-secure, ingress TLS), not here. See upstream configuration.--email-domain=yourcompany.com— restricts login to your org’s email domain(s). Replace with your actual domain, or pass the flag multiple times for more than one domain.--cookie-secure=true— only send the session cookie over HTTPS. Requires the dashboard to actually be served over HTTPS end-to-end (see the ingress note below).--reverse-proxy=true— trustX-Forwarded-*headers (notablyX-Forwarded-Proto) from the Ingress/Gateway that terminates TLS. Without this, oauth2-proxy sees plain HTTP from the proxy and — with--cookie-secure=true— refuses to set the session cookie, which breaks login.--redirect-url=https://thoras.yourcompany.com/oauth2/callback— must be the real external hostname of the dashboard, over HTTPS, and must exactly match the sign-in redirect URI registered on the Okta app.--skip-provider-button=true— since there’s only one provider (Okta), skip the “choose a provider” landing page and redirect straight to login.
4. Deploy and verify
Exposing the sidecar externally
Point the dashboard’s existingService at the oauth2-proxy sidecar port
(4180) instead of the app’s port (8080), so all traffic — however you
already expose the dashboard — is forced through the auth check:
Service using whichever the chart already supports:
Ingress
ingressClassName/parentRefs to match your cluster’s actual Ingress
controller or Gateway, and terminate TLS there (or upstream at a
cert-manager-issued Certificate bound to it). Once DNS for
thoras.yourcompany.com resolves and a valid TLS cert is issued, visiting the
dashboard URL should trigger the login flow described above.

