Interface OAuthConfig

OAuth configuration interface

Configuration object for OAuth2 Authorization Code flow with PKCE. Used when initializing OAuth instances for secure authentication. This interface defines all the parameters needed to configure OAuth authentication flows.

const oauthConfig: OAuthConfig = {
clientId: 'your-client-id',
redirectUri: 'https://your-app.com/callback',
scopes: ['read', 'write'],
state: 'random-state-string'
};
// Minimal OAuth configuration
const oauthConfig: OAuthConfig = {
redirectUri: 'https://myapp.com/callback'
};

// Full OAuth configuration with custom endpoints
const oauthConfig: OAuthConfig = {
clientId: 'custom-client-id',
redirectUri: 'https://myapp.com/callback',
appURL: 'https://custom-auth.mosaia.ai',
apiURL: 'https://custom-api.mosaia.ai',
apiVersion: '2',
scopes: ['read', 'write', 'admin'],
state: 'csrf-protection-token'
};
interface OAuthConfig {
    redirectUri?: string;
    appURL?: string;
    scopes?: string[];
    clientId?: string;
    apiURL?: string;
    apiVersion?: string;
    state?: string;
}

Properties

redirectUri?: string

Redirect URI for the OAuth flow (optional)

appURL?: string

App URL for authorization endpoints (optional defaults to https://mosaia.ai)

scopes?: string[]

Array of scopes to request (optional)

clientId?: string

OAuth client ID (required only if not using default)

apiURL?: string

API URL for API endpoints (required only if not using default)

apiVersion?: string

API version (required only if not using default)

state?: string

State parameter for CSRF protection (optional)