Tenant Delegated
Tenant Delegated means your application stays in charge of who your users are. Users log in on your own login page, using the accounts they already have, and LockMCP never sees their password. Your backend hands the hub a short-lived code, the hub trades it for a session, and from then on tool calls run as that user.
It's the most involved of the three identity models — your backend implements a small contract of its own — but it's the only one that keeps the entire login experience inside your product.
This page and everything under Tenant Delegated in the sidebar apply only to connections whose identity model is Tenant Delegated. Using a different model? See Identity Brokering or Token Exchange.
When to choose it
| Choose Tenant Delegated when | Choose something else when |
|---|---|
| Your users already have accounts in your app and you don't want a second login | You'd rather not build or host any auth endpoints → Identity Brokering |
| The login screen needs your branding, your MFA, your session rules | You already run a standard OIDC identity provider → Token Exchange |
| You need per-user authorization decided by your own backend on every call | You just want the fastest path to a working connection |
What you need to build
Your backend exposes a small set of HTTPS endpoints that LockMCP calls server-to-server, all HMAC-signed:
| Endpoint | Purpose |
|---|---|
Login page (/mcp-login) | Where LockMCP sends the user to sign in |
| Exchange | Trades the short-lived code your login page issued for a session token |
| Validate | Confirms a session token is still good, and returns the user's roles |
| Refresh (optional) | Extends a session without a fresh login |
| Logout (optional) | Ends a session early |
You'll also need a user directory (any way of authenticating users — email/password, SSO, whatever you already have), publicly reachable HTTPS endpoints, and the HMAC shared key the wizard generates for you.
Setting it up
Connections go through a five-step wizard that's the same for every identity model. Tenant Delegated differs in two places:
Step 3 · Identity setup asks for your Login, Exchange and Validate URLs, generates the HMAC key, and maps your app's role names onto LockMCP roles. Use Test endpoints for a live reachability check before continuing.
Step 4 · Provision doesn't just configure — it runs a seven-check certification suite that actually walks the login → exchange → validate sequence against your live endpoints. All seven must pass before the connection will provision. See Troubleshooting for what each check verifies.
Who assigns roles
A connection's roles have exactly one owner, and the role mapping decides which:
| Role mapping | Who sets a user's roles on this connection |
|---|---|
| Set | Your login. Every sign-in, and every session check, sets the user's roles from the roles your app reports, through the mapping. Roles on this connection can't be assigned by hand in Members or in an invite, because the next sign-in would replace them. |
| Empty | Your workspace admins, in Members or when inviting. Sign-ins don't change anyone's roles. |
Map each app role to a role on this connection (or to a workspace role with read access only). A login can't hand out a workspace role that carries more than that, such as a role that can manage settings. Step 3 only offers roles a login can assign, and flags any mapping that can't be applied. The connection page keeps flagging it until it's fixed.
Workspace (platform) roles are always assigned by admins. A sign-in through your app never changes them, so someone who manages LockMCP keeps that access however they sign in. Users who only call tools don't need an invitation: their first sign-in through your app creates them. Every role a sign-in removes is recorded in the audit log as Roles replaced by app login.
How a tool call actually authenticates
- An AI client hits your connection's MCP endpoint with no credentials and gets a
401plus a pointer to the authorization server. - The client starts an OAuth flow; LockMCP redirects the user to your login page.
- The user signs in on your page. Your app issues a short-lived code and redirects back.
- LockMCP calls your Exchange endpoint (HMAC-signed) and receives a session token.
- LockMCP mints its own short-lived ES256 JWT for the client. That's what the AI client presents from then on.
- On tool calls, LockMCP verifies its JWT and calls your Validate endpoint to confirm the underlying session is still valid and to pick up the user's current roles.
The practical upshot: your backend stays the authority on every request. Revoke a session on your side and the next validate call shuts the AI client out.
Where to go next
| Page | What it's for |
|---|---|
| Contract Specification | The normative reference — exact schemas, HMAC formula, token formats, TTLs, error codes. Start here if you're implementing. |
| Environment Setup | Required configuration and domain verification |
| Endpoints | Working reference implementations of every endpoint, in five languages |
| HMAC Signing | How to verify the signature on incoming requests |
| Session Tokens | The opaque mcp: session token lifecycle |
| Login Page | The /mcp-login page contract |
| Troubleshooting | What to do when a step fails |