An app whose sign-in is the backend Pramaan provisions (
auth.backend.*) has no SAML. It
can use the generic OpenID Connect route.
Through your own sign-in service
Set the enterprise connection up in your own sign-in service, then check each session withauth.token.verify as you already do. Pramaan checks the session token. Your sign-in service
checked the enterprise identity. Membership, roles and linking accounts by email stay your
app’s decisions, and an email domain alone grants nothing.
Generic OpenID Connect
Pramaan checks the identity; your app creates the user and the session.- Save the connection once per customer with
auth.enterprise-connection.create: your label for the customer, the issuer address, the client id and secret their administrator gave you, and your app’s exact redirect addresses. It needs approval. The secret is write-only, and no result carries the issuer or the client id. Who among your customers may set a connection up is your app’s own check. - Start sign-in with
auth.enterprise.start. Your server makes a freshstate,nonceand PKCE code verifier, keeps them in the visitor’s session, and sendsstate,nonceand the S256codeChallenge. Redirect the visitor to theauthorizationUrlyou get back. - When the visitor returns, compare
statewith the session’s. Stop if it differs. - Redeem the code with
auth.social.exchange:providerKey: "enterprise", theconnectionRef,code, the sameredirectUri, thestateas it came back to your callback,pkceVerifierandexpectedNonce. Only a sign-in you started is redeemed, once, within 10 minutes. Pramaan refuses astatethat is not the one the sign-in was started with, so a mismatch is caught even if step 3 is forgotten; a refusedstateuses nothing up. Still make the comparison in step 3: only your app sees the visitor’s session.
Rules for your app
- An identity is
connectionRefplussubjectId, neversubjectIdalone. Keep therefthat create returned and key identities by your own id for that connection: a list row’srefis another string for the same connection. emailVerifiedis exactly what the identity provider stated. When it isfalse, do not link the sign-in to an existing account by that email and do not grant access because of it.- A verified email is still only what one customer’s identity provider says, and that provider
can state any address. Never use the email to find or link an account from another connection
or another way of signing in: find the account by
connectionRefplussubjectIdonly. - The issuer must be an
httpsaddress on a public host name, and its discovery document must name it exactly. The addresses that document names must be on the issuer’s own host, or on a host you listed inendpointHostswhen you created the connection. stateis for enterprise sign-in only: required withconnectionRef, and refused as an unknown field without it.- Redirect addresses are matched exactly. A code is used once: after an error, start again.