OpnForm handles OAuth redirect URLs automatically. You don’t need to manually configure redirect URLs in your OAuth applications - the system generates them dynamically based on your domain configuration.
Developer Guide
If you’re looking to add a new OAuth integration to OpnForm, check out the complete developer guide with architecture overview and implementation steps.
Available OAuth Integrations
Google OAuth
Authentication, Google One Tap, and Google Sheets integration for form data export
Stripe OAuth
Payment processing integration for collecting payments through forms
Telegram OAuth
Notification integration for form submission alerts via Telegram
Google OAuth
Google OAuth enables user authentication and integrates with Google Sheets for exporting form submissions.Features
- User Authentication: Allow users to sign up and log in with their Google accounts
- Google One Tap: Seamless authentication with Google’s One Tap sign-in widget
- Google Sheets Integration: Export form submissions directly to Google Sheets
- Automatic Scope Management: OpnForm requests appropriate permissions based on usage
Setup Steps
1
Create Google Cloud Project
Navigate to the Google Cloud Console and create a new project or select an existing one.
2
Enable APIs
Enable the following APIs for your project:
- Google+ API (for authentication)
- Google Drive API (for Sheets integration)
- Google Sheets API (for spreadsheet access)
3
Configure OAuth Consent Screen
- Go to APIs & Services > OAuth consent screen
- Choose External user type (unless using Google Workspace)
- Fill in the required information:
- App name: Your application name
- User support email: Your contact email
- Developer contact information: Your email address
- Add scopes if needed (OpnForm handles this automatically)
- Add test users if your app is in testing mode
4
Create OAuth Credentials
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth 2.0 Client IDs
- Select Web application as the application type
- Add authorized origins:
- Leave redirect URIs empty - OpnForm handles these automatically
For Google One Tap to work, ensure your domain is added to the authorized origins. This enables the seamless authentication widget to function properly.
Save the Client ID and Client Secret for environment configuration.
5
Configure Environment Variables
Add the following variables to your backend
.env
file:The Google Fonts API key is optional and only needed if you want to use Google Fonts in your forms.
Stripe OAuth
Stripe OAuth enables payment processing capabilities within OpnForm, allowing you to collect payments through your forms.Features
- Payment Collection: Accept payments directly through forms
- Multiple Accounts: Connect multiple Stripe accounts for different forms
- Automatic Processing: Handle payment intents and confirmations seamlessly
Setup Steps
1
Create Stripe Application
- Log into your Stripe Dashboard
- Navigate to Settings > Connect > Platform settings
- Click Get started to enable Stripe Connect
2
Configure Platform Settings
- Set your Platform name and Support email
- Add your website URL in Brand settings
- Configure Redirect URIs (OpnForm handles these automatically)
- Save your settings
3
Get OAuth Credentials
- In Settings > Connect > Platform settings
- Find your Platform client ID in the OAuth settings section
- Note your Client secret (you may need to generate one)
Save the Client ID and Client Secret for environment configuration.
4
Configure Environment Variables
Add the following variables to your backend
.env
file:These OAuth credentials are separate from your regular Stripe API keys. The OAuth credentials enable connecting multiple Stripe accounts, while regular API keys are for direct payment processing.
Telegram OAuth
Telegram OAuth enables notification integration, allowing OpnForm to send form submission alerts to Telegram chats.Features
- Form Notifications: Receive instant notifications when forms are submitted
- Rich Messages: Formatted messages with form data and submission details
- Multiple Chats: Connect different Telegram accounts for various forms
Domain Requirement: Telegram requires that your bot is linked to a valid domain with HTTPS. Localhost URLs are not supported. For development, consider using a tunneling service like localtunnel to expose your local development server with a public HTTPS URL.
Setup Steps
1
Create Telegram Bot
- Open Telegram and search for @BotFather
- Start a conversation and send
/newbot
- Follow the prompts to name your bot and choose a username
- Save the Bot Token provided by BotFather
Your bot token will look like:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz
2
Link Domain to Bot
- Send
/setdomain
to @BotFather - Select your bot from the list
- Enter your domain (e.g.,
yourdomain.com
or for development:abc123.loca.lt
) - BotFather will confirm the domain has been linked
For Development: If you’re developing locally, use localtunnel to get a public HTTPS URL:Use the provided
.loca.lt
URL as your domain with BotFather.3
Configure Environment Variables
Add the following variable to your backend
.env
file:The bot ID is automatically extracted from the bot token (the numeric part before the colon), so you don’t need to configure it separately.
4
Test Your Bot
- Start a conversation with your bot in Telegram
- Connect the bot in OpnForm’s integration settings
- Submit a test form to verify notifications work
You should receive a formatted message with form submission details.
Security Considerations
Important Security Notes:
- Never commit OAuth credentials to version control
- Use environment variables for all sensitive configuration
- Regularly rotate your OAuth secrets and API keys
- Monitor OAuth application usage in your provider dashboards
Troubleshooting
Google OAuth Issues
Google OAuth Issues
Common problems and solutions:
- “OAuth app blocked”: Ensure your OAuth consent screen is properly configured
- “Invalid redirect URI”: OpnForm handles redirects automatically - don’t manually configure them
- “Insufficient permissions”: Check that required APIs are enabled in Google Cloud Console
- “Quota exceeded”: Monitor your API usage in Google Cloud Console
Stripe OAuth Issues
Stripe OAuth Issues
Common problems and solutions:
- “Invalid client ID”: Verify your Stripe Connect platform is properly set up
- “Webhook failures”: Ensure your domain is accessible and SSL is configured
- “Payment processing errors”: Check your Stripe account status and verification
- “Connect account creation failed”: Verify platform settings and business details
Telegram OAuth Issues
Telegram OAuth Issues
Common problems and solutions:
- “Bot not responding”: Ensure your bot token is correct and the bot is not disabled
- “Message delivery failed”: Check that users have started a conversation with your bot
- “Formatting errors”: Telegram uses MarkdownV2 formatting for rich messages
- “Rate limiting”: Telegram has message rate limits - avoid sending too many messages quickly
Testing Your Integration
1
Verify Configuration
Check that all environment variables are set correctly and restart your application.
2
Test Authentication
Try logging in with each OAuth provider to ensure the authentication flow works.
3
Test Integrations
- Google: Create a form and test exporting to Google Sheets
- Stripe: Set up a payment form and process a test transaction
- Telegram: Configure notifications and submit a test form
4
Monitor Logs
Check your application logs for any OAuth-related errors or warnings.
With properly configured OAuth integrations, your OpnForm installation will support seamless user authentication and powerful third-party service integrations.