Overview
Securing your Pylon API credentials is essential. Exposed credentials can lead to unauthorized access to mortgage rate data and potential compliance violations.Credential security
Store credentials in environment variables
Never embed credentials directly in code. Use environment variables instead:Keep credentials out of version control
Add credential files to.gitignore:
Use separate credentials per environment
Never share credentials between sandbox and production:Use a secrets manager in production
For production deployments, consider using a dedicated secrets management service such as AWS Secrets Manager, HashiCorp Vault, Google Cloud Secret Manager, or Azure Key Vault.Access token security
Cache tokens
Access tokens are valid for 24 hours. Cache and reuse them rather than requesting a new token for each API call:Never log tokens
If you need to debug authentication issues, log only the first and last few characters:eyJhb...XyZ.
Transmit tokens securely
Always use theAuthorization header. Never include tokens in URLs, as they may appear in server logs:
Additional recommendations
- Monitor API usage for unusual patterns or unexpected spikes in traffic
- Implement rate limiting on your end to protect against runaway requests
- Log authentication events for auditing and debugging purposes
- Keep HTTP client libraries updated to patch security vulnerabilities
- Use firewalls to restrict outbound traffic to Pylon endpoints only