Sign in with Entra ID
Prism has no Entra mode, and does not need one. app.identity.mode: easyauth
means "something in front of me asserts who the user is, in
X-MS-CLIENT-PRINCIPAL-* request headers". On Azure Container Apps the
platform does that natively, which is where the mode got its name. Anywhere
else — OpenShift, plain Kubernetes — you put an OIDC proxy in front of the app
and configure it to emit those headers, and Prism cannot tell the difference.
That is the whole integration. What makes it worth a page of its own is that two pieces of it are counter-intuitive enough to be copied rather than inferred, and one omission leaves the install wide open.
The mode is
easyauth. Notentra, notoidc, notproxy. Since 0.7.0 an unrecognisedapp.identity.modefails the render; before that it silently meantstatic, which installs cleanly, comes up healthy, and gives every visitor the same shared operator identity with/adminopen.
The shape
browser ──▶ Route / Ingress ──▶ OIDC proxy ──▶ prism-app
(Entra ID) (identity.mode: easyauth)
Three properties make it safe, and all three are yours to arrange:
- The proxy is the only way in. Prism trusts those headers from anything that can reach it — see Close the bypass, which is not optional.
- The proxy overwrites the identity headers rather than passing the caller's through.
- Prism matches super admins on the email the proxy asserts, so the claim carrying it has to be one that is actually populated for your users.
1. Register the application in Entra ID
In Entra ID → App registrations → New registration:
| Field | Value |
|---|---|
| Redirect URI | Platform Web, https://<your-prism-host>/oauth2/callback |
| Client secret | Certificates & secrets → New client secret. Copy it now; it is shown once |
| Issuer | https://login.microsoftonline.com/<tenant-id>/v2.0 — the proxy needs this |
No optional claims are needed for the configuration below. oid (the stable
per-user GUID) and preferred_username (the user principal name) are both in
the ID token by default, and those are the two values it uses.
Which address Prism ends up matching is worth being deliberate about, and
it is decided here rather than in Prism. The configuration below asserts
preferred_username — the UPN — as the user's address, so
app.auth.superAdmins must list UPNs. In most tenants a member's UPN is their
email address and the distinction never surfaces. Where it does not hold —
guest and B2B accounts, whose UPN looks like
someone_example.com#EXT#@yourtenant.onmicrosoft.com — that account signs in
perfectly, shows a UPN where a name belongs, and can never hold super admin,
because the address Prism is matching is not one anybody would put on the list.
If your intended administrators are in that position, add email under
Token configuration → Add optional claim → ID, and use the alternative
mapping in Which value goes where below — it costs
you the GUID as the identity key and gets you the mail attribute as the
address. Populate the mail attribute too: an optional claim for an attribute
nobody has set adds nothing.
To control who may sign in at all, use Entra's own assignment: in Enterprise applications → your app → Properties, set Assignment required to Yes, and assign the users or groups. Prism has no allowlist under this mode — it admits everyone the proxy admits.
Nobody needs a row on Admin → App users to sign in: your identity provider decides who gets in. A row there is how you make someone a super admin or, with scoped viewers on, set their data scope or organization email.
2. Configure the proxy
The worked example is oauth2-proxy
v7.13. Header injection needs its --alpha-config file; the equivalent
command-line flags cannot express it.
server:
BindAddress: 0.0.0.0:4180
upstreamConfig:
upstreams:
- id: prism
path: /
uri: http://prism-app.<namespace>.svc.cluster.local
passHostHeader: true
# The default is 1s, which delivers a streamed answer in one-second
# lumps. Prism streams tokens as they are produced.
flushInterval: 100ms
injectRequestHeaders:
# Prism's identity key (`sub`). Reads oauth2-proxy's Email session field,
# which `userIDClaim` below populates with the Entra object id. This looks
# wrong and is not — see the note under the table.
- name: X-MS-CLIENT-PRINCIPAL-ID
values:
- claim: email
# The address super admins are matched on.
- name: X-MS-CLIENT-PRINCIPAL-NAME
values:
- claim: preferred_username
# NOT optional. See "Close the bypass" below.
- name: X-MS-CLIENT-PRINCIPAL
values:
- claim: user
providers:
- id: entra
provider: oidc
clientID: <application-client-id>
clientSecret: <client-secret>
oidcConfig:
issuerURL: https://login.microsoftonline.com/<tenant-id>/v2.0
emailClaim: email
# The stable per-user GUID, and what ends up in -PRINCIPAL-ID.
userIDClaim: oid
with --cookie-secret, --email-domain=* and
--redirect-url=https://<your-prism-host>/oauth2/callback alongside it.
Three things in that file are traps, and each one was found by running it rather than by reading the documentation:
claim:does not take an arbitrary ID-token claim. oauth2-proxy resolves only its own session fields there —user,email,groups,preferred_username,id_token,access_token. Writingclaim: oidis not an error and does not warn: the header is simply absent, and Prism then refuses every request with "TRUST_EASYAUTH=1 but no Easy Auth identity headers on the request" — a message that points at the app, three layers from the mistake.userIDClaimpopulates oauth2-proxy'sEmailfield, not itsUserfield. That is why-PRINCIPAL-IDreadsclaim: emailand gets a GUID. The obvious mapping (claim: userfor the id,claim: emailfor the address) delivers the two values swapped, and Prism will happily run that way — showing GUIDs where names belong and matching super admins against nothing.--email-domain=*is load-bearing here. WithuserIDClaim: oidthe proxy's Email field holds a domainless GUID, so any domain restriction rejects every user in your tenant. Do the restricting in Entra (assignment required, above), which is where it belongs.
And one that is not a trap so much as a thing worth knowing: claim: user is
not the UPN. Against real Entra it resolves to the token's sub — an opaque,
per-application identifier that means nothing to a human and matches nothing on
your admin list. It is used above only to overwrite the claims blob, where any
value will do. preferred_username is the claim that carries the UPN.
Which value goes where
Prism takes the user's email from -PRINCIPAL-NAME, and its identity key
(sub) from -PRINCIPAL-ID. oauth2-proxy will only surface two distinct
values to inject — whatever userIDClaim names, and preferred_username — so
there are two workable mappings and you pick by which address you want matched:
userIDClaim | -PRINCIPAL-ID (sub) | -PRINCIPAL-NAME (email) | |
|---|---|---|---|
| Default, above | oid | claim: email → the GUID | claim: preferred_username → the UPN |
| When the UPN is not an email | email | claim: preferred_username → the UPN | claim: email → the mail attribute |
The default gives a key that survives a user being renamed, and matches on the UPN. The alternative matches on the real mail address — needed for guest accounts — at the cost of keying identity on the UPN, so renaming a user there starts them a fresh history. Neither can do both; there is no third slot.
3. Point Prism at it
app:
identity:
mode: easyauth
auth:
superAdmins:
ingress:
enabled: false # the Route points at the PROXY, not the app
superAdmins matters as much here as under email sign-in: see
What an upgrade does to the admin list. Unlike local mode
the chart cannot refuse to render for you — under easyauth an empty list is a
legitimate install — so it warns and installs. Details in
Identity and roles.
4. Close the bypass
Without token verification, Prism under
easyauth believes those headers from anything that can reach it. There is
no signature, no IP allowlist and no second check. On Azure Container Apps the platform guarantees the headers and
strips forged copies; here, you do. A request straight to the Service, skipping
the proxy, looks like this:
$ curl -H "X-MS-CLIENT-PRINCIPAL-ID: anything" \
-H "X-MS-CLIENT-PRINCIPAL-NAME: [email protected]" \
http://prism-app/whoami
{"sub":"anything","email":"[email protected]","role":"super_admin"}
Full super admin, from two headers and no credential. Three things close it.
The chart refuses the second one, its own Ingress pointed at the app.
app.ingress.allowHeaderIdentity lifts that refusal, but not with viewer
scoping on. With viewer scoping on the chart also renders the first
(Restrict what a viewer sees):
-
A NetworkPolicy admitting traffic to
prism-apponly from the proxy:apiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata:name: prism-app-from-proxy-onlyspec:podSelector:matchLabels:app.kubernetes.io/name: prism-apppolicyTypes: [Ingress]ingress:- from:- podSelector:matchLabels:app.kubernetes.io/name: oauth2-proxyConfirm your cluster actually enforces NetworkPolicy — on a cluster with no network plugin that implements it, this object is decoration.
-
No second door.
app.ingress.enabled: false, and the Route or Ingress resolves to the proxy. An Ingress left pointing atprism-appis the bypass above, published. So the chart refusesapp.ingress.enabled: trueundereasyauthwithout token verification. -
Overwriting
X-MS-CLIENT-PRINCIPAL, as the config in step 2 does. The proxy overrides only the headers it is told to, so a caller's own base64 claims blob otherwise reaches Prism untouched. Prism ignores it as long as-PRINCIPAL-NAMEis email-shaped — map that header to Entra'snameclaim instead ofpreferred_username, a very natural mistake, and the blob is what Prism reads for the email it matches super admins against.
A proxy key, so one mistake is not enough
A NetworkPolicy your
cluster does not enforce, or an Ingress someone adds later, and the curl
above works again. A proxy key makes that a two-mistake failure: set
secrets.proxyKey, have the proxy send it, and Prism refuses any request
that does not carry it before it reads a single identity header. The
refusal is a 403 that says the request "did not come through the configured
sign-in proxy".
It is not a replacement for the NetworkPolicy. Anyone who can read the app pod's environment or the Secret holds the key. It closes the accident, not an attacker who is already inside the pod.
secrets:
proxyKey: "<openssl rand -hex 32>" # with existingSecret: the key proxy-key
In the oauth2-proxy file from step 2, add one more injected header. Read it
from an environment variable rather than writing it in the file. In this
file, a literal value: is base64-encoded bytes, not the key as written.
injectRequestHeaders:
# ...the three headers from step 2, then:
- name: X-Prism-Proxy-Key
values:
- fromEnv: PRISM_PROXY_KEY
Give the oauth2-proxy container that variable from a Secret of its own,
holding the one key it sends. Do not point it at the app's proxy-key: while a
key is rolled that holds two, and the proxy would send both as one value. As
with the identity headers, the proxy replaces any copy a caller sent rather
than passing it on.
The self test's sign-in proxy key line passes only after Prism has refused
two forged sign-ins, one with a wrong key and one with none, so it shows the
key is checked and not merely set. With no key under header trust, the line
is a warning. The key is optional and unset by default. Roll it without
an outage: Rotate a credential.
Verify the signed ID token
Required with viewer scoping on, and worth turning on
without it. With app.identity.easyauth.token.verify: true Prism takes the
signed-in user from the Entra ID token the proxy forwards, checks its
signature against your tenant's signing keys, and stops reading the
X-MS-CLIENT-PRINCIPAL-* headers altogether. A request with no token, or one
that does not verify, gets a 401. The forged curl in step 4 then signs in as
nobody, and the NetworkPolicy stays as a second line.
What is checked: the RS256 signature; the issuer
(https://login.microsoftonline.com/<tenant-id>/v2.0); the audience, which is
your proxy's application (client) id; the tenant id; the token's expiry, issue
and not-before times; and that it is a version 2.0 ID token. The user's
identity key is the token's oid. The address Prism matches them on, for
superAdmins and App users, is app.identity.easyauth.token.emailClaim:
preferred_username (the UPN) by default, as step 2's default mapping sent it,
or email (the mail attribute), as its alternative did. If that claim is not
an email address, the other one is used.
Forward the token
Add one header to injectRequestHeaders in step 2's file:
injectRequestHeaders:
# ...the three above, unchanged...
- name: X-MS-TOKEN-AAD-ID-TOKEN
values:
- claim: id_token
id_token is one of oauth2-proxy's own session fields, so claim: resolves
it. Do not forward the access token (--pass-access-token,
X-Forwarded-Access-Token): from a plain Entra sign-in it is a Microsoft Graph
token whose audience is not Prism, and Prism refuses it. The header name is
app.identity.easyauth.token.header if you need another; Prism also accepts the
value as Bearer <token>.
Keep the token fresh
An Entra ID token lives about an hour. oauth2-proxy's session cookie lives far longer, so without a refresh every user is refused an hour after signing in. Both of these are required:
offline_accessin the scope, so the proxy holds a refresh token:scope: openid email profile offline_accesson the provider.--cookie-refreshshorter than the token's lifetime, for example--cookie-refresh=30m, so the proxy renews the session, and with it the ID token, before the token expires.
A user who sees "Sign-in token refused: token expired" on a session that is still signed in is this, not Prism.
Point Prism at your tenant
app:
identity:
mode: easyauth
easyauth:
token:
verify: true
tenantId: <tenant-id> # a GUID; "common" is refused
audience: <application-client-id> # the proxy's app registration
The chart refuses to render scoping on under easyauth without these, and
the app refuses to start without them.
With the token verified, a claim in it can also give a person the app admin
role: the Admin pages, and no questions. Set
app.identity.easyauth.appAdminClaim. See
Give the role from Entra ID.
The signing keys
By default the app fetches your tenant's keys from
https://login.microsoftonline.com/<tenant-id>/discovery/v2.0/keys, so the app
pod needs HTTPS egress to login.microsoftonline.com (egress). It
keeps them for a day, fetches again when a token names a key it has not seen
(Entra rotates keys without notice), and keeps serving the last good set for up
to a week if the endpoint is unreachable. With no good set at all it refuses
every sign-in, and the self test's viewer identity line says so.
With no egress to Entra, give the keys as a ConfigMap instead:
curl -s https://login.microsoftonline.com/<tenant-id>/discovery/v2.0/keys > jwks.json
kubectl -n <namespace> create configmap prism-entra-keys --from-file=jwks.json \
--dry-run=client -o yaml | kubectl apply -f -
and set app.identity.easyauth.token.keysFile.configMap: prism-entra-keys. The
app re-reads the file when the ConfigMap changes. You own its freshness: when
Entra starts signing with a key the file does not hold, every sign-in is refused
until you refresh it, so run the two commands above on a schedule.
Upgrading an install that used the headers
Keep matching people on the same address: leave emailClaim at
preferred_username if you used step 2's default mapping, and set it to email
if you used the alternative.
The identity key becomes the Entra object id. If you used the default mapping, that is what Prism already stored. If you used the alternative mapping, Prism stored the UPN; each of those users is moved to their object id on their first sign-in with a verified token whose UPN is that value, keeping their role and data scope. A user stored under any other value is refused as a mismatch until an administrator re-links them on the App users page. The self test's viewer identity line counts the users not yet moved.
5. Prove it
In this order, because each step tells you something the next one assumes.
-
Sign in. Browse to your host. You should land on the Microsoft sign-in page and come back to Prism's chat.
-
Check who Prism thinks you are —
https://<your-prism-host>/whoami:{"sub":"11111111-2222-4333-8444-555555555555",suba GUID andemailan address means the mapping is the right way round. Swap them and you have theuserIDClaimtrap. An emptyemail, or a#EXT#string where an address belongs, means-PRINCIPAL-NAMEis carrying a UPN that is not email-shaped — the guest-account case, and the second mapping in Which value goes where is the answer.role: userwhere you expectedsuper_adminmeans the asserted address is not the one inapp.auth.superAdmins; the address in this output is the one Prism matched, so compare against that rather than against what you assumed. -
Open
/adminand/selftest. Both require super admin, so this proves the tier resolved and not just the sign-in. -
Try the bypass. From another pod in the cluster, run the
curlfrom step 4 against the app's Service. It must fail to connect. If it answers, your NetworkPolicy is absent or unenforced, and the sign-in page is decoration. With a proxy key set, an answer is the 403 that names the proxy rather than a sign-in, but that still means the NetworkPolicy is not holding.
Session lifetime and signing out
Behind a sign-in proxy the session belongs to the proxy and to Entra ID, not to Prism. Prism shows no sign-out button in this mode unless you give it the address of one (below), and a sign-out that cleared only the proxy's cookie would not hold: the next request goes back to Entra, which still has the user signed in and signs them straight back in. So for an installation that holds sensitive figures, the controls are how long a session lasts, and a sign-out that ends the Entra session too.
Session lifetime is the main control
Set both of these. The first is the proxy's; the second is Entra's, applied each time the proxy goes back to Entra.
- The proxy's cookie lifetime. With oauth2-proxy,
--cookie-expireis how long the session cookie lasts (oauth2-proxy's default is 168 hours) and--cookie-refreshis how often the proxy renews the session from Entra (Keep the token fresh needs it on). Because a refresh renews the session, do not treat--cookie-expirealone as the upper limit. With Azure Container Apps' built-in authentication (Easy Auth), it is the session cookie's expiry in the app's authentication settings,login.cookieExpiration. - Entra Conditional Access sign-in frequency. A Conditional Access policy
scoped to Prism's application registration, with the Sign-in frequency
session control set to the longest a person should stay signed in without
signing in again. Entra applies it at sign-in and at each renewal, so with
--cookie-refreshon it bounds the session however long the cookie lasts. A session the proxy never renews is bounded by the cookie's expiry alone.
A sign-out that holds
A real sign-out is the proxy's sign-out chained to Entra's end-session endpoint, so both sessions end and the user is asked to sign in again.
With oauth2-proxy, link people to:
https://<your-prism-host>/oauth2/sign_out?rd=<encoded-entra-logout-url>
where the unencoded Entra logout URL is
https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/logout?post_logout_redirect_uri=https://<your-prism-host>/
URL-encode it as the rd value, because it carries a query string of its own.
oauth2-proxy only redirects to a host it allows, so add
--whitelist-domain=login.microsoftonline.com to its flags. Register
https://<your-prism-host>/ as a redirect URI on the application registration,
or Entra will not send the user back to it.
With Easy Auth, link people to:
https://<your-prism-host>/.auth/logout?post_logout_redirect_uri=/
Easy Auth's own sign-out also signs the user out of Entra, so it needs no chain.
To put it in Prism's header, set app.identity.signOutUrl to that address
and run helm upgrade. The header bar then shows a Sign out link to it
on every page that has the bar: the chat, Your answers, the answer pages and
the admin pages. The self test and ingestion activity pages have no header
bar, so they show none. The value is an https:// address, or a path on
Prism's own host such as /.auth/logout?post_logout_redirect_uri=/, written in
printable ASCII with no spaces and no $ (percent-encode anything else, $ as
%24); anything else is
refused when the chart renders. It works under every identity mode except
local, which has its own Sign out and refuses the setting: under static
too, for a proxy that guards access to Prism without passing it an identity. Unset, which is the default, the header shows no sign-out, so
publish the link where your people will find it instead: your intranet's page
for Prism, or a bookmark you hand out with the address.
Two things to tell people before you rely on it:
- It signs them out of Microsoft in that browser, not only out of Prism. Entra's sign-out ends their Microsoft session there, so Outlook on the web, Teams on the web and other applications signed in through Entra in that browser can ask them to sign in again.
- On a managed device it may not ask them to sign in again. Where the device holds a Primary Refresh Token (an Entra-joined or registered device) and your Conditional Access policies allow it, the next visit can sign them back in silently. The session has ended; the device signed them in again. Sign-in frequency still applies.
What this mode does not give you
- A sign-out of its own. The session belongs to the proxy, so Prism's
header links to a sign-out only when you set
app.identity.signOutUrlto the proxy's own sign-out chained to Entra's, as A sign-out that holds describes. - A sign-in event. The proxy signs people in, so Prism never sees it.
The audit log records
session_startedinstead: a person's first request after roughlyapp.auth.sessionIdleHours(default 8) with none. The same applies underiap. - An in-app allowlist. Who may sign in is an Entra question; only
localmode has an allowlist. - Continuity of saved work across a switch. Saved prompts, conversations
and feedback key on the identity
sub. Underlocalmode that is the lowercased email address; undereasyauthwith the default mapping it is the Entraoid, so a deployment moving from email sign-in to Entra hands everyone a clean slate. To carry it over,-PRINCIPAL-IDhas to keep asserting that same address —userIDClaim: emailwith-PRINCIPAL-IDreadingclaim: email. That buys continuity at the price of a key that moves when a mailbox does.
What this page has been proved against
The header contract, the claim mapping, the header-overwrite behaviour and the
streaming pass-through were verified end to end against oauth2-proxy v7.13.0 —
first against a stand-in OIDC issuer, then against a real Entra ID tenant,
signing a real account in through a real authorization-code flow into a real
Prism with easyauth on. sub came back as the account's actual directory
object id and the super-admin tier resolved off the asserted UPN. The values in
step 2 are the configuration that passed, not a reconstruction.
These layers around it were not exercised and are the likely places for a first install to stick:
- Your Route's own idle timeout. Prism holds an SSE connection open for the
length of an answer. On OpenShift the default HAProxy timeout is 30 seconds,
which is shorter than a long answer takes; set
haproxy.router.openshift.io/timeouton the Route (10m, as Installing Prism step 1e asks for). An answer that starts streaming and stops part-way, reproducibly, at the same number of seconds, is this and not the model. - The proxy key header. The
X-Prism-Proxy-Keyinjection in A proxy key was checked against oauth2-proxy v7.13.0's source, not run. - Guest and B2B accounts. The tenant this was proved against signed in a
member account, whose UPN is their email address. The
#EXT#case above is reasoned from how Entra issues those UPNs, not observed — if your administrators are guests, do step 5 before you rely on it.
The settings in Session lifetime and signing out are from the proxy's and Entra's own documentation and have not been run against a real tenant here. Sign out once, from a browser that is not on a managed device, and confirm the next visit asks for a password before you tell people to rely on it.
Token verification has been exercised against tokens and signing keys made in
Prism's own test suite. Forwarding the ID token through oauth2-proxy with
claim: id_token, and keeping it fresh with --cookie-refresh, have not yet
been run against a real tenant.
If sign-in fails, the self test reports the identity mode the app is actually running in, which is the fastest way to tell a proxy problem from a Prism one.