Enterprise SSO is part of the Enterprise plan and is switched on for your workspace on request. Contact your Mihu account manager or support@mihu.ai to enable it.
When to use it
- You run a platform, a marketplace or an internal tool, and your users also use Mihu.
- You want to show or change Mihu data inside your product without asking each customer for an API key.
- You need every action to be attributed to the person who approved it, with the same permissions they have in Mihu.
How onboarding works
1
Enterprise SSO is enabled
We switch on the SSO layer for your Enterprise workspace.
2
Your application is registered
You send us your application’s name, logo, the redirect URIs your users should return to, and the permissions your application needs, for example
agents, contacts and campaigns. We register it and send you a client ID and a client secret. The secret is shown once; store it on your server.3
You add the Connect button
Your application sends users to the Mihu consent screen and exchanges the result for tokens, as described below.
4
Your users connect
Each user approves once. From then on your application calls the Mihu API with their token and keeps it fresh in the background.
1. Send the user to the consent screen
Open this address, usually in a popup.https://acme.mihu.ai stands for your user’s workspace address; every request in this guide goes to that address.
The user signs in to Mihu if needed and sees which permissions your application asks for.
- Allow: the browser returns to your redirect URI with a one-time code.
- Cancel: the browser returns with
error=access_denied. - Missing permissions: if the user’s own Mihu account lacks any of the requested permissions, Allow is disabled and the missing ones are listed. There are no partial grants.
state matches what you sent. The code works once and expires after 60 seconds.
2. Exchange the code for tokens
Do this on your server, never in the browser.3. Call the API
Send the access token in theAuthorization header on every request.
- The token only opens what the user approved. Anything else answers
403. - Access always follows the user’s current permissions in Mihu. If their role changes, your access changes with it, immediately.
- Every action is recorded under the user who approved the connection.
4. Keep the connection alive
Refresh a few minutes before the access token expires, or when a call answers401.
- Always store the new refresh token. The old one stops working the moment the refresh succeeds.
- Refresh from one place at a time. Using an old refresh token again is treated as a stolen token and ends the whole connection, so two parallel refreshes for the same connection will break it.
invalid_grantmeans the connection is over. Mark it as disconnected and ask the user to connect again.
5. Disconnect
When a user disconnects inside your application, revoke the connection so it disappears from their Mihu account too.Who can switch a connection off
Connections can end from the Mihu side at any time. Your application should expect that and simply ask the user to connect again.When calls fail
What is inside the access token
You do not need to read the token, but you can. It is a signed JWT (RS256), and the public keys are published athttps://acme.mihu.ai/.well-known/jwks.json.
Checklist before you go live
- The client secret and all tokens are stored on your server only.
- You check
stateon every return from the consent screen. - You store the new refresh token after every refresh, and refresh one connection at a time.
- You handle
401,403andinvalid_grantby refreshing, stopping or asking the user to reconnect. - You offer a Disconnect option that calls the revoke endpoint.