Identity & auth
DioscHub does not authenticate users. Your app already does that. What DioscHub needs is to be told who the signed-in user is, and to be handed the auth artifacts it should forward to your MCP servers on that user’s behalf. That handoff is auth binding, and it is BYOA: you bring your own auth, DioscHub carries it through.
The auth-binding model
Section titled “The auth-binding model”The chat widget never handles credentials. Instead, your backend tells DioscHub who the user is, server-to-server, and ties that identity to the widget’s live connection:
- The widget opens its connection to DioscHub and receives a connection id (
wsId). Until it is bound, the widget knows it has no identity yet. - The widget posts that
wsIdto a bind endpoint on your backend (an endpoint you write), carrying your app’s own session cookie so your backend knows who the user is. - Your backend calls DioscHub’s
POST /auth/bind— server-to-server, authenticated with a secret admin API key — passing thewsId, the user’s identity, and the auth artifacts to forward. - DioscHub ties that identity and those artifacts to the connection, and tells the widget it is ready.
From then on, every tool call on that connection runs as the bound user, with the artifacts forwarded as described in Forward the user’s auth.
The auth artifacts
Section titled “The auth artifacts”What you hand DioscHub to forward is an opaque map of headers and optional cookies:
{ "headers": { "Authorization": "Bearer <the user's token>" }, "cookies": { "session": "<the user's session cookie>" }}DioscHub stores these against the connection and forwards them verbatim to your MCP servers on each call. It does not parse or interpret them — their meaning is entirely between your backend and your MCP servers. And because they are forwarded on the transport, never placed in the model’s context, the Assistant stays Credential Blind.
In this section
Section titled “In this section”Next: Implement the bind endpoint.