First design: identity provider in the middle
- Sign-inThe user signs in on an internal-looking identity domain, not on our product.
- MCP serverIt exchanges the user's token at the identity provider for a short-lived backend token, so the agent never holds a token the backend accepts directly.
- After a short idle periodThe identity provider's online session ends. The AI client keeps refreshing its own token with an offline refresh token that lasts for days.
- ExchangeThe identity provider refuses the exchange, and nothing is written to our logs. The user sees “login expired” until they disconnect and connect again.
The connection depended on the identity provider's online session.
