Quick Start
Get your application up and running with qPapel Auth in just a few minutes.
Step 1: Get Your API Keys
Log in to your web dashboard
Navigate to Dashboard → API Integrations → API Keys
You will see three keys:
API Key (starts with
pk_)Product Secret Key (Base64 string)
Product HMAC Key (Base64 string)
Copy all three keys
API Key: pk_00000053_3916244955f4dde9ba64aa6f2e6077dd
Product Secret Key: qYD2/+HYqhinpHGY5neAcTHEQaDNiQCvA2h+Cw2t68U=
Product HMAC Key: Tf/Sfqz/ojbVHbfEeSudx0G+0CfRKno5IFeTJdrJuvM=These are example keys. Use your actual keys from the dashboard.
Step 2: Create Your First Application
Create a new file main.cpp:
#include <iostream>
#include <string>
#include "qPapel.h"
int main() {
std::cout << "--- qPapel Auth Demo ---\n" << std::endl;
// Step 1: Configure
qPapel::AuthConfig config;
config.apiKey = "pk_your_api_key";
config.productSecretKey = "your_secret_key";
config.productHmacKey = "your_hmac_key";
// Step 2: Initialize
qPapel::ProtectedAuth auth;
auth.Init(config);
std::cout << "[1/3] Initializing..." << std::endl;
// Step 3: Connect to server
std::cout << "[2/3] Connecting to server..." << std::endl;
if (!auth.SendHeartbeat()) {
std::cerr << "Connection failed: " << auth.GetLastError() << std::endl;
return 1;
}
std::cout << "Connected successfully!\n" << std::endl;
// Step 4: Validate license
std::cout << "[3/3] Enter license key: ";
std::string licenseKey;
std::cin >> licenseKey;
std::cout << "Validating..." << std::endl;
if (auth.ValidateKey(licenseKey)) {
std::cout << "\nAuthenticated successfully!" << std::endl;
std::cout << "Session Token: " << auth.GetSessionToken() << std::endl;
// Your protected application code here
std::cout << "\nWelcome to your protected application!" << std::endl;
} else {
std::cerr << "\nAuthentication failed: " << auth.GetLastError() << std::endl;
return 1;
}
return 0;
}Step 3: Replace API Keys
Replace the placeholder keys with your actual keys from the dashboard!
Step 4: Build and Run
Press F7 or click Build → Build Solution
Expected output:
Press Ctrl+F5 or click Debug → Start Without Debugging
Expected output:
Step 5: Create a Test License
Go to Dashboard → Keys
Click "Generate New Key"
Configure:
Duration: 30 days
Max Devices: 1
Note: "Test License"
Click "Create"
Copy the generated license key
Generated license key format:
Example:
Step 6: Test Your Application
Run your application and enter the test license key:
Congratulations! Your application is now protected with qPapel Auth!
What Happens Behind the Scenes?
Next Steps
Now that you have a working application, explore more features:
Common Issues
Complete Example Application
For a full-featured example with menu system and all features, see:
Complete Example - Full application with menu
Basic Authentication - Simple auth example
Security Best Practices
Protect Your API Keys
Never commit API keys to version control!
Resources
Installation - Setup guide
Configuration - Detailed configuration
API Reference - Function documentation
Dashboard Guide - Web dashboard usage
Last updated