Skip to content

Authentication

Bizon supports multiple authentication methods for connecting to source APIs. Configure authentication in the source.authentication section of your pipeline configuration.

TypeUse CaseDescription
oauthOAuth 2.0 APIsToken refresh with client credentials
api_keyAPI key authenticationBearer or custom header token
bearerBearer tokensSimple bearer token (alias for api_key)
basicHTTP Basic AuthUsername/password encoding
cookiesSession-basedCookie and header injection

For APIs that use OAuth 2.0 with refresh tokens. Bizon automatically refreshes expired access tokens.

source:
name: hubspot
stream: contacts
authentication:
type: oauth
params:
token_refresh_endpoint: https://api.hubapi.com/oauth/v1/token
client_id: your-client-id
client_secret: your-client-secret
refresh_token: your-refresh-token

Parameters:

ParameterRequiredDefaultDescription
token_refresh_endpointYes-URL to refresh the token
client_idYes-OAuth client ID
client_secretYes-OAuth client secret
refresh_tokenNo-Refresh token for obtaining new access tokens
scopesNo-List of OAuth scopes
token_expiry_dateNo-Initial token expiry date
access_token_nameNoaccess_tokenName of access token in response
expires_in_nameNoexpires_inName of expiry field in response
grant_typeNorefresh_tokenOAuth grant type
refresh_request_bodyNo-Additional body parameters for refresh request
response_field_pathNo-dpath to token in nested response

Advanced Example:

authentication:
type: oauth
params:
token_refresh_endpoint: https://oauth.example.com/token
client_id: BIZON_ENV_CLIENT_ID
client_secret: BIZON_ENV_CLIENT_SECRET
refresh_token: BIZON_ENV_REFRESH_TOKEN
scopes:
- read:contacts
- read:companies
grant_type: refresh_token
access_token_name: access_token
expires_in_name: expires_in

For APIs that accept a static token in the Authorization header.

source:
name: notion
stream: pages
authentication:
type: api_key
params:
token: your-api-token

Parameters:

ParameterRequiredDefaultDescription
tokenYes-The API token or key
auth_methodNoBearerPrefix before the token (e.g., Bearer, Token, ApiKey)
auth_headerNoAuthorizationHTTP header name

Generated Header:

Authorization: Bearer your-api-token

Or with custom settings:

X-API-Key: Token your-api-token

For APIs that use HTTP Basic authentication with username and password.

source:
name: kafka
stream: topic
authentication:
type: basic
params:
username: your-username
password: your-password

Parameters:

ParameterRequiredDefaultDescription
usernameYes-Username for authentication
passwordNo""Password (can be empty)
auth_methodNoBasicAuth method prefix
auth_headerNoAuthorizationHTTP header name

Generated Header:

The username and password are Base64 encoded:

Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

For APIs that require session cookies or custom headers.

source:
name: internal_api
stream: data
authentication:
type: cookies
params:
cookies:
session_id: abc123
auth_token: xyz789
headers:
X-Custom-Header: custom-value

Parameters:

ParameterRequiredDefaultDescription
cookiesYes-Dictionary of cookie name-value pairs
headersNo{}Additional headers to include

Never hardcode secrets in your configuration files. Use environment variables with the BIZON_ENV_ prefix:

authentication:
type: oauth
params:
client_id: BIZON_ENV_CLIENT_ID
client_secret: BIZON_ENV_CLIENT_SECRET
refresh_token: BIZON_ENV_REFRESH_TOKEN

Set the environment variables before running:

Terminal window
export BIZON_ENV_CLIENT_ID="your-client-id"
export BIZON_ENV_CLIENT_SECRET="your-client-secret"
export BIZON_ENV_REFRESH_TOKEN="your-refresh-token"
bizon run config.yml

Some public APIs don’t require authentication:

source:
name: pokeapi
stream: pokemon
# No authentication section needed
API TypeRecommended Auth
OAuth 2.0 APIs (HubSpot, Google, Salesforce)oauth
Simple API keys (Notion, Stripe)api_key
Kafka with SASLbasic
Legacy session-based APIscookies
Public APIsNone