auth
Initiate OAuth authentication
Initiates OAuth authentication flow for a specified provider and project. The OAuth provider must be configured and enabled for the project first. After user authentication, redirects to the OAuth provider's consent screen.
GET
/api/auth/oauth/{provider}/{projectId}Authentication
Public — No Auth Required
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
provider | string | Yes | OAuth provider identifier (e.g. google, github). |
projectId | string | Yes | Project ID for which OAuth is configured. |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
redirect_url | string | No | The URL to redirect to after authentication. Must be pre-registered in project settings. |
SDK setup
Create a client instance. No authentication is required for this endpoint.
import { MudbaseClient } from "mudbase";
const client = new MudbaseClient();import { MudbaseClient } from "mudbase";
const client = new MudbaseClient();Example request
Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.
const result = await client.auth.oauthInitiate({
provider: "matrix calculate",
projectId: "proj_ErwADdSJie1y"
});const result = await client.auth.oauthInitiate({
provider: "matrix calculate",
projectId: "proj_ErwADdSJie1y"
});Try It Live
Test this endpoint with your own credentials. Your requests will be sent to the live API.
No Request Yet
Send a request to see the full inspector
Responses
200Success (OAuth flow initiated; in most cases the server responds with 302 redirect).
json
{
"redirectUrl": "https://youthful-conservative.net/"
}{
"redirectUrl": "https://youthful-conservative.net/"
}302Redirect to OAuth provider's consent screen
400OAuth provider not configured or not enabled for this project
json
{
"error": "google authentication not enabled for this project"
}{
"error": "google authentication not enabled for this project"
}401Authentication required or invalid token.
403Access denied or insufficient permissions.
404Project not found (exact backend message).
500Internal server error.
Errors
| Code | Meaning |
|---|---|
400 | OAuth provider not configured or not enabled for this project |
401 | Authentication required or invalid token. |
403 | Access denied or insufficient permissions. |
404 | Project not found (exact backend message). |
500 | Internal server error. |