{
"oauthApiKey": "your-secure-oauth-api-key-here"
}✅ This is CORRECT - use the original, unobfuscated key in the server config
The client code contains the obfuscated version that decrypts back to the original key.
Original: "your-secure-api-key-here"
↓ (reverse)
Layer 1: "ereh-yek-ipa-eruces-ruoy"
↓ (base64 encode with btoa - browser compatible)
Layer 2: "ZXJlaC15ZWstaXBhLWVydWNlcy1ydW95"
↓ (character shift)
Layer 3: [obfuscated string stored in code]
const apiKey = decryptApiKey(OBFUSCATED_OAUTH_API_KEY);
// Result: "your-secure-api-key-here"Client → Decrypt → "your-secure-api-key-here" → HTTP Header → Server
Server → Compare with config.json → "your-secure-api-key-here" → ✅ Match
cd proxy-server
node server.js# This should work (with correct key)
curl -H "x-oauth-api-key: your-secure-api-key-here" \
http://localhost:3001/api/auth/config/chatflow_1
# This should fail (with wrong key)
curl -H "x-oauth-api-key: wrong-key" \
http://localhost:3001/api/auth/config/chatflow_1Load your chatbot with a chatflow that has OAuth configured, and verify:
- OAuth configuration is fetched successfully
- Authentication flow works properly
- No plain-text API keys visible in browser dev tools
- Server logs show successful OAuth config requests
- Browser dev tools show obfuscated key in source code
- Network tab shows correct API key in request headers
- Authentication flow completes successfully
- Requests without API key should return 401
- Requests with wrong API key should return 401
- Plain-text API key should not be visible in client code
- ❌
"oauthApiKey": "ereh-yek-ipa-eruces-ruoy"(reversed - WRONG) - ❌
"oauthApiKey": "ZXJlaC15ZWstaXBhLWVydWNlcy1ydW95"(base64 - WRONG)
{
"oauthApiKey": "your-secure-api-key-here"
}- Generate a strong, unique API key
- Update the obfuscated value in
src/constants.ts - Update the server config with the same original key
- Test the complete flow
// config.json
{
"oauthApiKey": "prod-secure-key-abc123xyz789"
}// constants.ts - update the layer1 value
const layer1 = '987zyx321cba-yek-eruces-dorp'; // reversed production key- 401 Errors: Check that server config matches decrypted client key
- Decryption Failures: Verify obfuscation layers are correctly implemented
- CORS Issues: Ensure allowed domains include your client origin
- Log the decrypted key (temporarily) to verify it matches server config
- Check server logs for API key validation messages
- Verify network requests include correct headers