Credentials

Credentials can be configured on a per-server basis and be global or per-user basis.

Introduction

Gatana splits authorization into two components:

  • Authorization Configuration: describing what form credentials should have
  • Credentials: the resolved tokens/values which will be passed when calling the tool

Gatana supports OAuth 2.1 and API keys. It sends credentials to the server as follows:

  • API keys: Use {{ credentials.keys.MY_API_KEY }} in the remote MCP URL (for example, a query parameter), HTTP headers, environment variables, or the command.
  • OAuth access tokens: Gatana sends the token in the Authorization header with the Bearer scheme on each request. There is no template expression for OAuth tokens.

The credentials can be scoped to the server; meaning that all Gatana users share the same credentials when calling the tools, or they can be user-scoped; meaning that each user has their own credentials. Additionally, each profile can have their own set of credentials. See Profiles for more information

Tool Refresh Policy

You can control which credentials (if any) should be used for refreshing the tools for a server. The available options are:

  • Server-Scoped Credentials: Use server-scoped credentials.
  • Any Credentials: Use any credentials, i.e. default/server-, user- or profile-scoped.
  • No Credentials: Do not use or require any credentials for tool refreshes. This is useful if the server does not require credentials for tool refreshes (e.g. OpenAPI servers, or any server that don't require authorization for tool listing), but does require them for tool-calling. It can simplify credential management by not requiring server-scoped credentials when user-scoped credentials are required.

Authorization Configuration

Gatana supports three methods of authorization for servers:

  • No authorization: the server can always be used without requiring any authorization.
  • OAuth 2.1: the server requires a bearer token which should be provded using OAuth 2.1.
  • OAuth Client Credentials the server requires a bearer token which should be provded using OAuth Client Credentials grant.
  • API Keys: one or more static key-value pairs which can be used in headers, command or environment variables.

Do not manually specify the Authorization header when using OAuth 2.1

Gatana will automatically inject a valid access token in the Authorization header using the Bearer-scheme. If an access token is expired, Gatana will use the refresh token to get a new one.

API Keys

The configuration is a list of the key names which the credentials should provide. The resulting credentials is the key-value pairs of this list which is provided in a separate step. The values can be used in headers, command arguments and HTTP headers using this expression:

{{ credentials.keys.MY_API_KEY }}

OAuth 2.1

For OAuth 2.1, you must provide the authorization server and client details. Gatana supports automatic discovery of the authorization server and dynamic client registration, or manual input.

If the server is a remote server, you may use the Discover OAuth from remote MCP URL button to attempt to discover the OAuth details automatically. If your remote server does not support this. You can also provide the issuer URL and click the Discover button next to the Issuer input field to automatically discover the authorization server details.

If the issuer supports dynamic client registration, i.e. there is a Client registration endpoint provided, you can click the Auto button next to the Client ID input field, and Gatana will automatically register a OAuth client.

Some issuers have no registration endpoint, but accept client ID metadata documents. Gatana then uses a client ID that is the URL of a small JSON document that Gatana publishes for the server. The issuer reads the client name and the redirect URI from that document. Each server has its own document, and the client has no secret, so the sign-in uses PKCE. The Auto button sets up this client too. The issuer must be able to fetch the document, so your Gatana installation needs a public URL that starts with https:// and that the issuer can reach.

For almost all cases, the Authorization Code grant should be used. Gatana also supports the Device Code grant, note however that some issuers (e.g. Google) places limits the credentials privileges when using this device code grant.

Some providers, e.g. Atlassian, returns ID tokens that has a different issuer (iss claim) than the MCP metadata issuer. Gatana rejects these tokens by default. An organization owner can accept them: open Settings and turn on Allow different OAuth issuer paths.

OAuth Client Credentials

For OAuth Client Credentials, you must provide the only the authorization server metadata in the server settings. Each credential consist of a Client ID + Client Secret and optional scopes, which will be used to generate an access token.

Credentials

The credentials are the resolved values which will be used when communicating with the server. The credentials can be scoped as following:

  • Server: there is one (1) set of credentials which will be used by all Gatana users accessing the tools of the server.
  • User: each Gatana user has their own credentials. A common scenario could be a server for e-mail, where each Gatana user should only get access to their own mailbox.
  • Profile: if the MCP session has a profile applied, and if the profile has a credential set for this server

MCP client-scoped credentials

We recommend to use Profiles if you want a different set of credentials for each of your MCP clients. For example, one set for e.g. Claude Code, one for GitHub Copoilot etc.

Provide the Credentials

There are three ways of providing credentails, directly in the Gatana App, through MCP protocol, or the Gatana Public API.

Gatana App

Navigate to the server details, and click on the Credentials setting. On this page, you can provide your user-scoped credentials, and, if you have administration privileges for this server, you can also provide the the default credentials.

MCP Protocol

The other way of providing credentials is over the MCP protocol; when Gatana calls a server on-behalf of a Gatana user, it will look up any required credentials. If credentials are missing, Gatana will fail the request with a MCP response looking like this:

{
  errorCode: 'need-credentials',
  authorizeUrl: 'https://gatana.ai/api/v1/mcp-servers/oauth/gt_V1St_GX-R8/begin',
  message: 'This tool requires secondary authorization. You must tell the end-user to ' +
    'please go to the authorizeUrl. After this is done, you can retry the tool call and it will work.',
}

The MCP client, i.e. the agent, is at this point expected provide the authorizeUrl to the end-user. The page under the URL will ask the user to fill out the necessary API Key values, or redirect the user to the configured OAuth 2.1 server to authorize, depending on the authorization method. This is only requried once per user.

The user does not sign in to Gatana during this process, because the token in the URL identifies the user. For this reason, a link is good for one authorization only, and it must be opened within 24 hours after Gatana made it. When a link was used or has expired, the agent gets a new one on the next tool call that needs it.

Gatana sends the same response when the provider no longer accepts a stored OAuth login, for example because the login was revoked or has expired. The message then says that the login was rejected. For a shared login, that is default or profile credentials, the message also says that everyone who uses it will act as the account that signs in.

Providing default server credentials requires admin permission on server

If the default credentials are missing and if user does not have the administration privileges for this server, then Gatana will not provide a authorizeUrl. It will instead inform the MCP client to let end-user know to contact their Gatana adminstrator. When the provider rejected a shared login, the message names the person who authorized it, if Gatana knows who that was.

Gatana Public API

If you would like to apply your own logic, you can use the Gatana Public API directly. You can check if user has credentials, get the URL where user can authorize over OAuth, or set the credentials directly.

Limitations

Only default credentials are availble for used in environment variables and command. When deploying a non-remote server, any expression will expand to the default credentials.

High priority for Gatana

Gatana considers this a high-priority issue, and is working on improving the user-scoped credential for local servers

Last updated on

On this page