Direct OAuth
Connect sources using browser OAuth flow with URL-based connections or BYOC (Bring Your Own Credentials).
Overview
Direct OAuth allows you to create source connections using the standard OAuth 2.0 browser flow. This method provides a seamless user experience where users authenticate directly through their service provider’s consent screen, without needing to manage tokens manually.
Airweave supports two main approaches for Direct OAuth:
- URL-based OAuth: Users authenticate through Airweave’s hosted OAuth flow
- BYOC (Bring Your Own Credentials): Use your own OAuth application credentials
Supported Connectors
Direct OAuth is supported by most Airweave connectors. Some connectors require you to provide your own OAuth application credentials (BYOC), while others can use Airweave’s hosted OAuth flow.
Connectors requiring BYOC:
- Dropbox, Gmail, Google Calendar, Google Drive
Connectors using Direct Authentication only:
- Bitbucket, GitHub, PostgreSQL, Stripe, CTTI
Most connectors also support authentication through external providers like Composio and Pipedream.
URL-based OAuth Flow
The URL-based OAuth flow is the simplest way to connect sources. Users are redirected to Airweave’s hosted OAuth flow, which handles the entire authentication process.
How it works
- Initiate Connection: Create a source connection using the URL-based authentication method
- User Consent: Users are redirected to the service provider’s consent screen
- Token Exchange: Airweave exchanges the authorization code for access and refresh tokens
- Data Sync: The connection is established and data synchronization begins
Creating a URL-based OAuth connection
Handling the OAuth callback
When using URL-based OAuth, you’ll receive an authorization URL that you need to redirect users to. After they complete the OAuth flow, they’ll be redirected back to your specified callback URL with the necessary parameters.
Important: OAuth browser flows (both standard and BYOC) cannot use sync_immediately=true
. The sync will automatically start after the user completes the OAuth authentication flow. Setting sync_immediately=true
will result in a validation error.
Redirect URI basics
The redirect_uri
is the URL where the user is sent after granting consent with the provider. It must exactly match an allowed redirect/callback URL configured for the OAuth app. Use it when you want users to return to your application after authentication (typical for hosted OAuth). For BYOC, configure the provider to allow Airweave’s callback (https://api.airweave.ai/oauth/callback
) and optionally set redirect_uri
so Airweave can forward the user back to your app after the token exchange.
BYOC (Bring Your Own Credentials)
BYOC allows you to use your own OAuth application credentials instead of Airweave’s hosted OAuth flow. This gives you more control over the authentication process and branding.
Benefits of BYOC
- Custom Branding: Use your own OAuth application with your branding
- Enhanced Security: Control your own OAuth application settings
- Compliance: Meet specific compliance requirements for your organization
- Rate Limits: Use your own rate limits instead of shared ones
Setting up BYOC
To use BYOC, you’ll need to:
- Create OAuth Application: Set up an OAuth application with the service provider
- Configure Redirect URI: Add Airweave’s callback URL to your OAuth application
- Provide Credentials: Use your client ID and client secret in the connection
How BYOC Detection Works
BYOC (Bring Your Own Credentials) is automatically detected when you provide both client_id
and client_secret
in the OAuthBrowserAuthentication
object. If you provide only one of these fields, the API will return a validation error.
BYOC Detection Logic:
- ✅ Both
client_id
ANDclient_secret
provided → BYOC mode - ✅ Neither
client_id
norclient_secret
provided → Standard OAuth browser flow - ❌ Only
client_id
OR onlyclient_secret
provided → Validation error
Creating a BYOC connection
OAuth Application Setup
Required Redirect URIs
When setting up your OAuth application for BYOC, you’ll need to add Airweave’s callback URL as an allowed redirect URI:
Required Scopes
Each connector requires specific OAuth scopes to function properly. Check the individual connector documentation for the required scopes.
Example: GitHub OAuth Application Setup
- Go to GitHub Settings → Developer settings → OAuth Apps
- Click “New OAuth App”
- Fill in the application details:
- Application name: Your application name
- Homepage URL: Your application URL
- Authorization callback URL:
https://api.airweave.ai/oauth/callback
- Note down the Client ID and Client Secret for use in your BYOC connection
Getting Help
If you encounter issues not covered in this documentation, please reach out to us at hello@airweave.ai or check our API Reference for more detailed information about the OAuth endpoints.