API calls for all endpoints tagged OAuth.
Summary
Functions
Complete MCP client OAuth flow Completes the OAuth flow for an MCP client after the user has authorized the request. This endpoint should be called after the OAuth provider redirects back to the callback endpoint and the OAuth token has been stored. It retrieves the pending MCP client configuration and establishes the connection with the OAuth-provided credentials.
Get OAuth config status Retrieves the current status of an OAuth configuration. Shows whether the OAuth flow is pending, authorized, or failed, and includes token expiration and scopes if authorized.
Get per-user OAuth flow detail
Returns the pending OAuth flow row metadata: which MCP client is being authorized, which identity (user / VK / session) the resulting token will be bound to, and whether an active token already exists for that binding (has_active_token). Requires management API authentication via Authorization: Bearer <API key>.
OAuth callback endpoint Handles the OAuth provider callback after user authorization. This endpoint processes the authorization code and exchanges it for an access token. On success, displays an HTML page that closes the authorization window.
Revoke OAuth config Revokes a server-level OAuth configuration and its associated access token. After revocation, the MCP client will no longer be able to use this OAuth token.
Start the upstream OAuth authorization for a pending flow
Reconstructs the upstream provider's authorize URL for a pending OAuth flow. The auth-landing page redirects the browser to that URL; the user completes upstream auth; the upstream provider redirects back to /api/oauth/callback, which exchanges the code for tokens server-side and stores them against the flow's identity. Returns 410 if the flow is no longer pending (expired / completed / failed). The caller should restart the original action to get a fresh flow.
Functions
@spec complete_mcp_client_o_auth(Tesla.Env.client(), String.t(), keyword()) :: {:ok, ExBifrost.Model.SuccessResponse.t()} | {:ok, ExBifrost.Model.BifrostError.t()} | {:error, Tesla.Env.t()}
Complete MCP client OAuth flow Completes the OAuth flow for an MCP client after the user has authorized the request. This endpoint should be called after the OAuth provider redirects back to the callback endpoint and the OAuth token has been stored. It retrieves the pending MCP client configuration and establishes the connection with the OAuth-provided credentials.
Parameters
connection(ExBifrost.Connection): Connection to serverid(String.t): MCP client IDopts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.SuccessResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_o_auth_config_status(Tesla.Env.client(), String.t(), keyword()) :: {:ok, ExBifrost.Model.OAuthConfigStatus.t()} | {:ok, ExBifrost.Model.ManagementErrorResponse.t()} | {:ok, ExBifrost.Model.BifrostError.t()} | {:error, Tesla.Env.t()}
Get OAuth config status Retrieves the current status of an OAuth configuration. Shows whether the OAuth flow is pending, authorized, or failed, and includes token expiration and scopes if authorized.
Parameters
connection(ExBifrost.Connection): Connection to serverid(String.t): OAuth config IDopts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.OAuthConfigStatus.t}on success{:error, Tesla.Env.t}on failure
@spec get_per_user_oauth_flow(Tesla.Env.client(), String.t(), keyword()) :: {:ok, ExBifrost.Model.McpOauthFlowDetail.t()} | {:ok, ExBifrost.Model.BifrostError.t()} | {:error, Tesla.Env.t()}
Get per-user OAuth flow detail
Returns the pending OAuth flow row metadata: which MCP client is being authorized, which identity (user / VK / session) the resulting token will be bound to, and whether an active token already exists for that binding (has_active_token). Requires management API authentication via Authorization: Bearer <API key>.
Parameters
connection(ExBifrost.Connection): Connection to serverid(String.t): Flow row IDopts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.McpOauthFlowDetail.t}on success{:error, Tesla.Env.t}on failure
@spec handle_o_auth_callback(Tesla.Env.client(), String.t(), keyword()) :: {:ok, String.t()} | {:error, Tesla.Env.t()}
OAuth callback endpoint Handles the OAuth provider callback after user authorization. This endpoint processes the authorization code and exchanges it for an access token. On success, displays an HTML page that closes the authorization window.
Parameters
connection(ExBifrost.Connection): Connection to serverstate(String.t): State parameter for OAuth security (CSRF protection)opts(keyword): Optional parameters:code(String.t): Authorization code from the OAuth provider. Present on success only;codeanderrorare mutually exclusive — one of them is always set.:error(String.t): Error code if authorization failed. Mutually exclusive withcode.:error_description(String.t): Error description if authorization failed
Returns
{:ok, String.t}on success{:error, Tesla.Env.t}on failure
@spec revoke_o_auth_config(Tesla.Env.client(), String.t(), keyword()) :: {:ok, ExBifrost.Model.SuccessResponse.t()} | {:ok, ExBifrost.Model.BifrostError.t()} | {:error, Tesla.Env.t()}
Revoke OAuth config Revokes a server-level OAuth configuration and its associated access token. After revocation, the MCP client will no longer be able to use this OAuth token.
Parameters
connection(ExBifrost.Connection): Connection to serverid(String.t): OAuth config IDopts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.SuccessResponse.t}on success{:error, Tesla.Env.t}on failure
@spec start_per_user_oauth_flow(Tesla.Env.client(), String.t(), keyword()) :: {:ok, ExBifrost.Model.BifrostError.t()} | {:ok, ExBifrost.Model.ManagementErrorResponse.t()} | {:ok, ExBifrost.Model.StartPerUserOauthFlow200Response.t()} | {:error, Tesla.Env.t()}
Start the upstream OAuth authorization for a pending flow
Reconstructs the upstream provider's authorize URL for a pending OAuth flow. The auth-landing page redirects the browser to that URL; the user completes upstream auth; the upstream provider redirects back to /api/oauth/callback, which exchanges the code for tokens server-side and stores them against the flow's identity. Returns 410 if the flow is no longer pending (expired / completed / failed). The caller should restart the original action to get a fresh flow.
Parameters
connection(ExBifrost.Connection): Connection to serverid(String.t): Flow row IDopts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.StartPerUserOauthFlow200Response.t}on success{:error, Tesla.Env.t}on failure