User-based MCP Authentication: Flip as Identity Provider

With Flip as identity provider, Ask AI calls your MCP server on behalf of the user who is chatting, with that user’s own identity and permissions. Your MCP server receives a Flip-issued access token that identifies the user, instead of a shared API key that every call uses. This lets the MCP server apply its own permissions per user, for example so that a team lead only sees their own team’s data, or an employee can only delete their own entries.

This authentication method is intended for MCP servers that already trust Flip as their identity provider, for example servers built by your own IT team, a partner, or an integrator. If your MCP server has its own authorization server, use MCP Enterprise Authentication instead. Read more about MCP Enterprise Authentication here.

Requirements

  • Ask AI is activated for your organisation.
  • You have access to the Admin Console with the permission to manage OIDC clients and Custom Agents.
  • Your MCP server validates access tokens issued by Flip. The developer guide at getflip.dev describes what the server has to check.

How it works

  1. You register your MCP server in Flip as an OIDC client and allow Ask AI to exchange tokens for this client.
  2. You add the MCP server as a connector in a custom agent and select Flip as identity provider as the authentication method.
  3. When a user chats with Ask AI and a tool of this connector is called, Ask AI exchanges the user’s Flip token for a new token that is addressed to your OIDC client. Ask AI sends this token to your MCP server.
  4. Your MCP server checks that the token comes from Flip and is meant for it, reads which user is calling, and applies that user’s permissions.

No secrets are stored in Flip for this method, and users do not have to log in again.

Step 1: Allow Ask AI to exchange tokens for your OIDC client

  1. Open the Admin Console.
  2. Go to Access & security > OIDC clients.
  3. Click Create OIDC client, or click Edit on an existing client that your MCP server already uses.
  4. Enter a Client ID, for example the name of your MCP server. Fill in the other details as needed.
  5. In the Token exchange section, click Add client and select ASK_AI as the allowed Flip client.
  6. Leave Redirect URIs empty if the client is only used for token exchange. A redirect URI is only needed for clients with a login flow.
  7. Click Create OIDC client or Save.

The details view of the client now shows Token exchange: ASK_AI. It also shows the OIDC Discovery URL, which your MCP server uses to validate tokens. You can copy it from here.

Good to know:

  • Only OIDC clients that list ASK_AI under Token exchange can be selected when you configure the connector in step 2.
  • You can remove ASK_AI from the Token exchange section at any time. Ask AI then stops receiving tokens for this client, and connectors that use it stop working until you allow it again.
  • Changes to the Token exchange section appear in the Audit Logs like other OIDC client changes.

Step 2: Add the MCP server as a connector

  1. In the Admin Console, go to AI assistant > Custom Agents.
  2. Click New Agent, or open an existing agent and go to Connectors.
  3. Click Add connector.
  4. Enter a Name and the MCP Server URL. Select the Transport your server supports.
  5. Under Authentication, select Flip as identity provider.
  6. Under OIDC client, select the client you prepared in step 1. Only clients that allow Ask AI to exchange tokens are listed.
  7. Click Save.

Flip immediately connects to the MCP server with an exchanged token and loads the available tools. If the connection fails, for example because token exchange is not allowed for the selected client or the server rejects the token, you see the error message from the identity provider and the connector is not saved.

  1. Under Tool permissions, choose for each tool whether Ask AI may use it. Then complete the Agent Details and User permissions and click Create agent.
  2. Set the agent to Active.

What your MCP server has to do

Share this with the team that operates the MCP server:

  • Accept a Bearer token issued by Flip on every tool call.
  • Validate the token against Flip: issuer, audience, and signature. Use the OIDC Discovery URL shown in the OIDC client’s details to find the keys.
  • The audience of the token is the Client ID of your OIDC client. The subject is the user who is chatting. The token also identifies the user’s organisation.
  • Apply the user’s permissions when executing the tool.

The full guide with examples is available on getflip.dev.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request