Authentication Overview
Authentication in Activepieces pieces is handled by thePieceAuth module from @activepieces/pieces-framework. It provides type-safe authentication methods that integrate seamlessly with the platform.
Authentication Types
Activepieces supports four authentication methods:OAuth2
Industry-standard OAuth 2.0 protocol
Secret Text
API keys and tokens
Custom Auth
Multiple custom fields
Basic Auth
Username and password
OAuth2 Authentication
OAuth2 is the most common authentication method for modern APIs. It allows users to grant access without sharing credentials.Basic OAuth2 Setup
OAuth2 Configuration
string
required
The OAuth provider’s authorization URL where users grant permissions
string
required
The endpoint to exchange authorization code for access token
string[]
required
Array of permission scopes to request from the OAuth provider
boolean
default:"true"
Whether authentication is required for all actions/triggers
boolean
Enable PKCE (Proof Key for Code Exchange) for enhanced security
OAuth2AuthorizationMethod
How to send the access token:
HEADER(default): In Authorization headerBODY: In request body
OAuth2GrantType
OAuth2 grant type:
AUTHORIZATION_CODE(default)CLIENT_CREDENTIALS
OAuth2 with Additional Props
Some OAuth providers require additional parameters during authentication:Using OAuth2 in Actions
Secret Text (API Key)
The simplest authentication method for APIs that use API keys or tokens.Basic Setup
With Validation
Using Secret Text in Actions
Custom Authentication
Custom auth allows you to define multiple fields for complex authentication requirements.Basic Setup
Real-World Example: AWS Credentials
Using Custom Auth in Actions
Basic Authentication
Traditional username and password authentication.Using Basic Auth
Auth Type Comparison
- OAuth2
- Secret Text
- Custom Auth
- Basic Auth
Best for:
- Modern cloud services
- Services with user-level permissions
- When you need refresh tokens
- Most secure
- No credential sharing
- Granular permissions
- Token refresh support
- More complex setup
- Requires OAuth app registration
- Users must authorize
Best Practices
Always Validate Credentials
Always Validate Credentials
Implement validation logic to test credentials during setup:
Use Appropriate Scopes
Use Appropriate Scopes
For OAuth2, request only the permissions you need:
Handle Token Expiration
Handle Token Expiration
Implement proper error handling for expired tokens:
Provide Clear Descriptions
Provide Clear Descriptions
Help users understand what credentials they need:
Next Steps
Create Actions
Use authentication in your actions
Properties Guide
Learn about property types for auth fields