Vidext v0.15.77 is out: See who spends your tokens, a tidier Settings, and more. Read the release notes →
Skip to Content
Vidext Docs

Authentication

OAuth 2.1 with PKCE and dynamic client registration, organization-scoped tokens, roles, scopes, lifetimes, and revocation.

The Vidext MCP server authenticates with OAuth 2.1: authorization code with PKCE, plus dynamic client registration. There are no long-lived API keys. Clients register themselves, a person authorizes in the browser, and tokens are short-lived and bound to one organization.

The OAuth issuer is:

https://app.vidext.com/api/auth

The flow (what your client does for you)

Challenge

The first request without a valid token gets HTTP 401 with a WWW-Authenticate: Bearer challenge. Its resource_metadata points at the protected-resource document for this endpoint, /.well-known/oauth-protected-resource/api/mcp.

Discovery

The protected-resource document names the authorization server. Its metadata is one document served at several paths (see the table below), so a client that starts from the issuer and one that reads the root path get the same answer.

Registration

A client without credentials registers itself at /api/auth/oauth2/register. Registration needs no prior account. A client can instead use an HTTPS URL that serves its client metadata document as its client_id.

Authorization

The browser opens /api/auth/oauth2/authorize. The person signs in, reviews the consent screen, and, if they are an admin or member in more than one organization, chooses one. The choice is bound to this authorization. An organization that requires single sign-on sends the person to its own Vidext address to sign in there; see AI assistants.

Tokens

The client exchanges the code and its PKCE verifier at /api/auth/oauth2/token. Refreshed tokens keep the same organization.

Endpoint reference

EndpointPath
Authorization server metadata/.well-known/oauth-authorization-server, also at /.well-known/oauth-authorization-server/api/auth (derived from the issuer, RFC 8414) and /api/auth/.well-known/oauth-authorization-server
OpenID configuration/.well-known/openid-configuration, also at /.well-known/openid-configuration/api/auth and /api/auth/.well-known/openid-configuration
Protected resource metadata/.well-known/oauth-protected-resource/api/mcp (the one the challenge names) and /.well-known/oauth-protected-resource; the /api/mcp/operator alias has its own at /.well-known/oauth-protected-resource/api/mcp/operator
Dynamic client registration/api/auth/oauth2/register
Authorize/api/auth/oauth2/authorize
Token/api/auth/oauth2/token
Revocation/api/auth/oauth2/revoke
User info/api/auth/oauth2/userinfo
JWKS (OAuth issuer)/api/auth/jwks

Two JWKS endpoints exist

/api/auth/jwks is the OAuth issuer's key set. The separate /.well-known/jwks.json serves the LMS (LTI) integration. Do not confuse them.

Who can connect

Only organization admins and members can use the server.

  • At authorization, the organization chooser lists only organizations where the person is an admin or member. Someone who belongs to no organization at all first creates their workspace, as admin, and then comes back to the consent screen. Someone who is only a learner or requester anywhere is shown that they cannot connect.
  • On every tool call, the server checks the role again. A person who is removed from the organization, or whose role changes to learner, gets the tool error forbidden from their next call, and their next token refresh is refused.
  • Learners and requesters (people whose request to join is still pending) cannot connect.

Admins and members see the same data over MCP: every module in the organization and the organization's processed sources. There is no per-team filtering for these two roles. See roles and permissions.

Organization scoping

A token is bound to one person in one organization, fixed at authorization. It stays bound if the person later switches workspace in the app. To work in another organization, authorize again.

Every read tool accepts optional organizationSlug and organizationId arguments; the author tools always work in the token's organization. Leave them out and the call uses the token's organization. Passing a different organization is refused with organization_scope_mismatch; passing an id and a slug that name different organizations is refused with invalid_organization_selector.

Scopes

ScopeWhat it grants
mcp:readThe read tools: search_knowledge, read_knowledge_source, and list_modules.
mcp:authorThe author tools: talking to the Vidext author, which plans and builds modules in the workspace and spends the organization's tokens doing it.
mcp:operator.readThe earlier name of mcp:read, from when the server was Vidext Operator. Tokens and refresh chains granted under it keep working on both addresses, but new clients should request mcp:read.

Request mcp:read and mcp:author; the protected-resource metadata advertises exactly those two. A token needs at least one of the three to reach the server, and is refused with 403 and insufficient_scope otherwise.

Each tool asks for its own scope. Calling a tool whose scope the token lacks answers 403 with a WWW-Authenticate challenge whose error is insufficient_scope and whose scope lists the scope the tool needs together with the ones the token already holds. A client that supports step-up authorization sends the user through the browser again to grant it, and keeps the access it had. The consent screen names each scope.

The server also supports the standard openid, profile, email, and offline_access scopes for sign-in and refresh.

Tokens

  • Access tokens are signed JWTs (typ: at+jwt) that last one hour. Their audience is the MCP endpoint URL, so a token minted for one origin is not accepted on another, and a token minted for /api/mcp is not accepted on the /api/mcp/operator alias, nor the other way round.
  • Refresh tokens last 30 days. Each refresh issues a new pair bound to the same organization, after checking the person still holds an admin or member role there.
  • Sender-constrained (DPoP) tokens are not accepted.
  • Web app session cookies are not accepted as bearer tokens. Only the OAuth flow, or the headless path below, mints a valid token.

Revocation

  • From your client. Remove the connection in your AI client. A client can also revoke its refresh token at /api/auth/oauth2/revoke, which stops further refreshes.
  • From Vidext. In Integrations, Connected includes the clients a person has connected to that workspace. Disconnect removes the client's grant there: its access token is refused on its next call, its next refresh is refused, and connecting again shows the consent screen. When no other workspace still holds a live grant for that client, its consent and refresh tokens are deleted too.
  • From the organization. Removing the person from the organization, or changing their role to learner, stops their tool calls on the next call and blocks the next refresh.
  • An access token that was already issued stays cryptographically valid until it expires (at most one hour), but every call re-checks the person's role.

When a token expires or is refused, the server answers 401 again and well-behaved clients re-run the flow.

Headless agents

For an agent with no browser, /auth.md describes an email-verified registration on behalf of an existing Vidext user:

  1. POST /api/agent/auth with the user's email. Vidext emails them a six-digit code, valid for 10 minutes, and returns a claim token.
  2. POST /api/agent/auth/claim/complete with the claim token and the code (five attempts). If the user is in more than one organization, the response asks the agent to retry with an organization_id.
  3. The response carries an access token for https://app.vidext.com/api/mcp, valid for 7 days, with mcp:read and mcp:author. There is no refresh token: when it expires or a call returns 401, register again.

Both POST endpoints accept an Idempotency-Key header (kept 24 hours) and are rate-limited per IP: 60 registrations and 30 completions per hour. One email address also gets at most 5 codes an hour, whoever registers it; past that, registration answers 429 with Retry-After. The same role rule applies on every tool call. Interactive OAuth is the recommended path; this one exists for agents that cannot open a browser.

On this page