Advanced Topics

Troubleshooting

Solutions for common integration issues and error scenarios.

Authentication Issues

Invalid HMAC signature error

This occurs when the request signature doesn't match the server's calculation.

  • Verify your client_secret matches the value in the admin panel
  • Ensure the timestamp in X-Timestamp is within 5 minutes of server time
  • The signature payload must be: timestamp + "." + body
  • Check for encoding differences — use UTF-8 consistently
Account locked — 423 response

Accounts are locked after 5 failed login attempts.

  • Wait 30 minutes for automatic unlock
  • Ask an admin to manually unlock from Admin Panel → Users
  • The response includes remaining_minutes until auto-unlock
Token expired immediately after issue

Usually caused by clock skew between the CAS server and your application.

  • Sync server clocks with NTP
  • Allow a 60-second tolerance when validating exp claims
  • Check the token_ttl configuration value

Connection Issues

Connection refused to CAS server
  • Verify the CAS_SERVER_URL environment variable
  • Check firewall rules — port 8000 (or your configured port) must be open
  • If using Docker, ensure containers are on the same network
  • Test connectivity: curl https://your-cas-server.com/api/health
SSL certificate errors
  • Ensure your SSL certificate is valid and not expired
  • For local development, add the self-signed CA to your trust store
  • Verify the certificate covers your domain (check SANs)
  • In PHP: set CURLOPT_CAINFO to your CA bundle path
Database connection timeout
  • Check DB_HOST and DB_PORT values
  • Verify PostgreSQL is running: pg_isready
  • Check max connections: SHOW max_connections;
  • Consider connection pooling with PgBouncer for high traffic

Rate Limiting

429 Too Many Requests

Your application is exceeding the rate limit. Check the Retry-After response header.

// Implement exponential backoff
const delay = Math.pow(2, retryCount) * 1000;
await new Promise(r => setTimeout(r, delay));

Debug Commands

# Check CAS server health
curl https://your-cas-server.com/api/health

# View Laravel logs
tail -f storage/logs/laravel.log

# Clear all caches
php artisan cache:clear && php artisan config:clear

# Test database connection
php artisan db:show

Contact & Support

If the above solutions don't resolve your issue, reach out to the CAS development team.

Email Support

For technical issues, integration help, or bug reports:

innovativesolution.com.np

Expected response time: within 24 hours on business days.

Development Team

CAS is developed and maintained by:

Innovative Solution Pvt. Ltd.

Lalitpur, Nepal

How to Report an Issue

When reporting an issue, please include the following details for faster resolution:

  1. 1. Description — What happened vs. what you expected
  2. 2. Steps to reproduce — How to trigger the issue
  3. 3. Error messages — Full error text or HTTP status codes
  4. 4. Environment — Language/framework, SDK version, CAS server version
  5. 5. Logs — Relevant entries from storage/logs/laravel.log (server) or your application logs (client)