Authentication
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. Returns an HTTP 302 redirect to the OAuth provider's consent screen. Note: Swagger "Try it out" may show "Failed to fetch" for this endpoint due to browser CORS restrictions on cross-origin redirects. Use top-level browser navigation or curl to test.
GET
/api/auth/oauth/{provider}/{projectId}SDK setup
Create a client instance. No authentication is required for this endpoint.
import { Configuration, AuthenticationApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
});
const authentication = new AuthenticationApi(configuration);import { Configuration, AuthenticationApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
});
const authentication = new AuthenticationApi(configuration);Example request
Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.
const { data: result } = await authentication.initiateOAuth("pixel hack", "proj_vPOuCmDWKb12");const { data: result } = await authentication.initiateOAuth("pixel hack", "proj_vPOuCmDWKb12");Playground
liveTest 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
Authentication
Public — No Auth Required
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
provider | string | Yes | — |
projectId | string | Yes | — |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
redirect_url | string | No | The URL to redirect to after authentication. Must be pre-registered in project settings. |
Responses
302Redirect to OAuth provider's consent screen
400OAuth provider not configured, not enabled, or missing required server/provider credentials
json
{
"error": "google authentication not enabled for this project"
}{
"error": "google authentication not enabled for this project"
}404Project not found
json
{
"error": "Project not found"
}{
"error": "Project not found"
}500—
Errors
| Code | Meaning |
|---|---|
400 | OAuth provider not configured, not enabled, or missing required server/provider credentials |
404 | Project not found |
500 | — |