> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Fix Metorial sign-in and OAuth errors for MCP clients
URL: https://metorial.com/docs/platform/troubleshooting/sign-in-and-oauth-errors

Fix a Metorial sign-in that fails with redirect_uri is not allowed for this portal, a No access page, a rejected consent, or an expired sign-in.

---

Find the message you see below. A portal admin fixes `redirect_uri is not allowed for this portal` under **Settings**, **Client Settings**, **Allowed OAuth Redirects**. A **No access** page means your account cannot open this portal.

**What you'll learn**

* How to allow the redirect a client needs, and nothing more
* What the messages on Metorial's consent screen mean
* How to renew a sign-in and reconnect an integration

**Before you start**

* The CLI for your own account: `npm install -g @metorial/cli`, then `metorial login`
* For portal changes, the admin CLI: `npm install -g @metorial/admin`, then `metorial-admin login`

## The redirect back to the client fails

### `redirect_uri is not allowed for this portal`

The portal does not allow the address the client returns to after the sign-in. Read the address from the `redirect_uri` parameter of the authorize URL the client opened, then enable the one option that covers it.

| Redirect URI                                               | Clients that use it                | Option                   | Pattern                  |
| ---------------------------------------------------------- | ---------------------------------- | ------------------------ | ------------------------ |
| `http://localhost:<port>/…` or `http://127.0.0.1:<port>/…` | Claude Code, Codex, Cursor desktop | **Localhost apps**       | `http://localhost:*/*`   |
| `http://<name>.localhost:<port>/…`                         |                                    | **Localhost subdomains** | `http://*.localhost:*/*` |
| `https://<host>/…`                                         | ChatGPT, Claude, Cursor web        | **Secure web apps**      | `https://*/*`            |
| A custom protocol such as `myapp://callback`               |                                    | **Native app deeplinks** | `*://*`                  |

A portal admin enables the option in the portal's **Settings**, **Client Settings**, under **Allowed OAuth Redirects**. From the CLI:

```bash
metorial-admin portals list
metorial-admin portals get <portal-id>
metorial-admin portals update <portal-id> \
  --allowed-redirect-url-filters '[{"url":"http://localhost:*/*"}]'
```

The command replaces the portal's whole list. Run `portals get` first and add the patterns your other clients still need. To allow a single web client, choose **Custom** and enter a narrower pattern such as `https://claude.ai/*`. Then start the sign-in again from the client.

### `Invalid redirect URI`

The callback in the sign-in request is not one the client registered. `Invalid oauth client` means Metorial does not know the client ID: the registration belongs to another portal, or it expired after three months without use. For both, remove the Metorial server from the client, add it again, and sign in.

### `Too many OAuth client registrations from this IP address`

More than 25 clients registered from one IP address within a minute, or more than 500 within an hour. Wait a minute and connect again.

## Consent screen

### `Access Denied`

The authorization request was rejected, and the client received `access_denied` with the description `The portal authorization request was denied.` The page `Request No Longer Active` reads "This authorization request can no longer be approved." For both, close the window and start the connection again from the client.

### `No integrations are available in this portal yet.`

The portal's catalog has nothing for you. An integration you may not use shows **Request Access** on the consent screen instead of a checkbox. Ask for it there, or from a terminal:

```bash
metorial catalog list
metorial request-access <catalog-item-id> -m "Need this for the support queue"
```

An admin shares the integration with your access group in Workforce, under **Access**, **Shared Resources**. To see what a group can use:

```bash
metorial-admin portals groups list <portal-id>
metorial-admin portals access list <portal-id> --consumer-group-id <group-id>
```

### `Select at least one Magic MCP server before approving this OAuth authorization.`

You continued without an integration. Select at least one, wait until its setup finishes, and continue. If nothing happens when you select one, a popup blocker stopped the setup window: select **Open Window** on the integration's row.

## Not allowed after sign-in

### `No access`

The page reads "This page doesn't exist or the account you're signed in with doesn't have access to it."

Select **Switch account** and choose your company account. If the page returns, a portal admin opens **Settings**, then **SSO**, and sets your connection to **Everyone has access**, or adds your group under **Selected SSO groups**. Where people are invited one by one, the admin invites you:

```bash
metorial-admin portals list
metorial-admin portals invites create <portal-id> --email <person@example.com> --name "<name>"
```

### `This email address is not allowed to access this portal.`

The portal only admits listed email addresses or domains. `This invite has expired.` and `This invite is no longer valid.` mean you have no open invitation. A portal admin invites you with the `portals invites create` command above.

### `Your organization does not have access to Metorial Portals.`

The organization's plan does not include portals. See [pricing](https://metorial.com/pricing).

## Expired or revoked sign-ins

A client's sign-in to Metorial lasts 30 days, and each refresh starts the 30 days again. These five messages have the same fix: sign in again from the client.

| Message                                          | Meaning                                                                |
| ------------------------------------------------ | ---------------------------------------------------------------------- |
| `Magic MCP token has expired`                    | The access token is past its 30 days and the client did not refresh it |
| `Invalid magic MCP token`                        | The token was revoked or deleted, or belongs to another portal         |
| `Invalid refresh token`                          | The refresh token was already used or is unknown. Each one works once  |
| `The authorization has expired`                  | More than 30 days passed since the last refresh                        |
| `The linked magic MCP token is no longer active` | The token behind the sign-in was revoked in Metorial                   |

```bash
claude mcp logout metorial && claude mcp login metorial
codex mcp logout metorial && codex mcp login metorial
```

In Cursor, sign in under **Customize**. In Claude, select **Reconnect** on the connector. In ChatGPT, open the plugin and connect again.

## Reconnect an integration

When the app itself revokes your access, tool calls for that integration fail until you connect your account again. Your AI clients stay signed in to Metorial.

```bash
# Your integrations, and the portal's catalog items, with their IDs
metorial list
metorial catalog list

# Opens the app's sign-in and keeps the integration's endpoint URL
metorial reconnect <catalog-item-id> <integration-id>

# Check it worked with a read-only tool
metorial tools <integration-id>
metorial call <integration-id> <tool-key> -d '{}'
```

In the portal, open the integration instead. It shows **Needs reconnect**. Select **Reconnect**, or **Reauthenticate** when it still works and your access changed.

### Connecting an app fails

`Integration setup ended with status: expired.` means you took too long at the app's sign-in. `Could not confirm whether the integration setup completed. Check your connection and try again.` means the portal lost its connection to Metorial while it waited. For both, select **Try Again**. If the app itself reports a redirect or callback mismatch, the integration uses [custom OAuth credentials](https://metorial.com/docs/platform/integrations/create-custom-oauth-credentials) whose OAuth app does not list Metorial's **Redirect URI**.

## Next steps

* [SSO and SCIM errors](https://metorial.com/docs/platform/troubleshooting/sso-and-scim-errors): identity provider errors, for admins
* [Tools are missing](https://metorial.com/docs/platform/troubleshooting/missing-tools): signed in, and a tool is not there
* [Error reference](https://metorial.com/docs/platform/troubleshooting/error-reference): every Metorial error message with its fix