OAuth Integration
Integrate OAuth flows into your application for seamless user authentication
Kambrium provides OAuth authorization URL generation that allows you to integrate OAuth flows into your application, enabling your users to connect their SaaS accounts (Pipedrive, Gmail, etc.) through your interface.
Overview
When building applications that need to connect to external SaaS tools on behalf of your users, you can use Kambrium’s Management API to generate OAuth authorization URLs. This allows users to authenticate with their preferred SaaS providers while maintaining your application’s user experience.
How It Works
Your application acts as an intermediary between your users and SaaS providers:
- Request OAuth URL: Your application calls Kambrium’s Management API to create an MCP server connection with OAuth authentication
- Get Authorization URL: Kambrium returns a standard OAuth authorization URL pointing to the SaaS provider
- User Authentication: Your user completes OAuth flow on the SaaS provider’s website (Pipedrive, Gmail, etc.)
- Credentials Stored: Kambrium securely stores the OAuth credentials for future API access
Implementation
Creating OAuth Connections
Use the Management API to create OAuth-enabled MCP server connections:
Integration Patterns
Popup Window Integration
Most applications open OAuth URLs in popup windows for better user experience:
Direct Redirect Integration
For simpler implementations, redirect the entire browser window:
OAuth Flow Details
Standard OAuth 2.0 Flow
The OAuth flow follows standard OAuth 2.0 Authorization Code flow:
- Authorization Request: User is directed to SaaS provider’s OAuth server
- User Consent: User logs in and grants permissions on provider’s website
- Authorization Code: Provider redirects to Kambrium’s callback with authorization code
- Token Exchange: Kambrium exchanges code for access/refresh tokens
- Secure Storage: Kambrium stores tokens for API access
Supported Providers
Kambrium supports OAuth for various SaaS providers:
- Pipedrive: CRM data access
- Gmail: Email management
- Additional providers: Check
/mcp-servers
endpoint for current list
Required Scopes
Each provider has predefined scopes that Kambrium requests:
Security Considerations
Secure Token Storage
- OAuth tokens are encrypted and stored securely by Kambrium
- Tokens are automatically refreshed when they expire
- Users can revoke access at any time
State Parameters
Kambrium uses cryptographically secure state parameters to prevent CSRF attacks:
PKCE Support
For providers that support it, Kambrium uses PKCE (Proof Key for Code Exchange) for additional security.
Error Handling
OAuth Errors
Handle common OAuth errors in your application:
API Errors
When creating OAuth connections:
Testing OAuth Integration
Using Test Providers
For development, use test OAuth providers or sandbox environments when available.
Handling Callbacks
Ensure your application properly handles OAuth callbacks: