A comprehensive ASP.NET Core web application demonstrating a multi-step home loan application process with integrated electronic signatures using BoldSign API.
This demo showcases:
- Multi-step form with personal, employment, and loan information collection
- Embedded signature workflow using BoldSign for document signing
- Real-time document status tracking via webhooks
- Template-based document generation with pre-filled form fields
- Responsive UI with progress indicators and form validation
Before running this application, ensure you have:
- .NET SDK 7.0 or later (Download)
- BoldSign Account with API access (Sign up)
- API Key from BoldSign account
- Template ID of your home loan template in BoldSign
- Webhook Secret Key for webhook signature validation
git clone <repository-url>
cd HomeLoanDemoCreate a .env file in the project root (or set system environment variables):
APIKEY=your_boldsign_api_key_here
TEMPLATEID=your_template_id_here
WEBHOOKKEY=your_webhook_secret_key_hereOr set environment variables in your shell:
Windows (PowerShell):
[Environment]::SetEnvironmentVariable("APIKEY", "your_key", "User")
[Environment]::SetEnvironmentVariable("TEMPLATEID", "your_template_id", "User")
[Environment]::SetEnvironmentVariable("WEBHOOKKEY", "your_webhook_key", "User")macOS/Linux (Bash):
export APIKEY="your_boldsign_api_key_here"
export TEMPLATEID="your_template_id_here"
export WEBHOOKKEY="your_webhook_secret_key_here"dotnet restoreDevelopment:
dotnet runThe application will start at https://localhost:7179 (or http://localhost:5183)
Production Build:
dotnet publish -c ReleaseHomeLoanDemo/
├── Controllers/
│ └── HomeController.cs # Main application logic
├── Models/
│ ├── TemplateDetails.cs # Form data model
│ └── ErrorViewModel.cs # Error page model
├── Views/
│ ├── Home/
│ │ ├── Index.cshtml # Main application form
│ │ ├── SignDocument.cshtml # Document signing page
│ │ ├── SignCompleted.cshtml # Completion confirmation
│ │ ├── _PersonalInfo.cshtml # Personal details partial
│ │ ├── _EmploymentInfo.cshtml # Employment details partial
│ │ └── _LoanInfo.cshtml # Loan details partial
│ └── Shared/
│ ├── _Layout.cshtml # Main layout
│ └── Error.cshtml # Error page
├── wwwroot/
│ ├── css/ # Stylesheets
│ ├── js/ # Client-side scripts
│ └── assets/ # Images and fonts
├── Program.cs # Application startup
├── appsettings.json # Configuration
└── HomeLoanDemo.csproj # Project file
- Personal Information - Collect name, date of birth, SSN, contact details
- Employment Information - Gather employer details, job title, income
- Loan Information - Capture loan amount, property details, loan purpose
- Document Signing - Generate and display embedded signature link
- Completion - Confirm signed document and provide download option
- ASP.NET Core 7.0 - Web framework
- BoldSign API - Electronic signature integration
- Razor Views - Server-side templating
- Bootstrap - Responsive UI framework
- jQuery - Client-side interactions
Key settings in appsettings.json:
- AllowedHosts - Configure for your deployment domain
- Logging - Adjust log levels for debugging
The application includes a webhook endpoint (/Home/Webhook) to track document signing completion:
- Endpoint:
POST /Home/Webhook - Signature Validation: All webhook requests are validated using the
WEBHOOKKEY - Completion Tracking: Signed documents are cached for download availability
Controllers/HomeController.cs- Contains document creation, signing, and webhook handling logicViews/Home/_LoanInfo.cshtml- Loan details form with numeric input validationViews/Home/Index.cshtml- Main multi-step form with progress trackingModels/TemplateDetails.cs- Data model for loan application form
The application includes:
- Null reference validation for environment variables
- Try-catch blocks for API operations
- User-friendly error messages
- Logging for debugging
✅ Best Practices Implemented:
- Environment variables for sensitive data (API keys, secrets)
- Webhook signature validation using BoldSign's
WebhookUtility.ValidateSignature() - HTTPS enforcement in production via
app.UseHttpsRedirection()and HSTS - CSRF token protection on all POST forms using
@Html.AntiForgeryToken() - Input validation on form fields with HTML5 attributes and client-side validation
- Null reference checks for safe environment variable handling
- Exception handling for API operations with user-friendly error messages
"Template ID is not configured"
- Ensure the
TEMPLATEIDenvironment variable is set correctly - Verify the template exists in your BoldSign account
Webhook validation failed
- Check that the
WEBHOOKKEYenvironment variable matches your BoldSign webhook secret - Verify webhook headers are being sent correctly
API connection errors
- Confirm your
APIKEYis valid and has appropriate permissions - Check your internet connection
For issues with BoldSign API:
This demo application is provided as-is for learning and demonstration purposes.
- Customize the loan application form to match your requirements
- Add additional form fields to the template in BoldSign
- Deploy to Azure App Service or your preferred hosting platform
- Integrate with your backend loan processing system