The Lamassu IoT Platform supports two primary authentication methods: JWT bearer tokens for management operations and mutual TLS (mTLS) for device enrollment and EST operations.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lamassuiot/lamassuiot/llms.txt
Use this file to discover all available pages before exploring further.
JWT Bearer Token Authentication
Overview
All management API endpoints require JWT (JSON Web Token) authentication using the Bearer scheme. This is the primary authentication method for:- Certificate Authority operations (
/api/ca/v1) - Device Manager operations (
/api/devmanager/v1) - DMS Manager operations (
/api/dmsmanager/v1) - Key Management Service (
/api/kms/v1)
Request Format
Include the JWT token in theAuthorization header with the Bearer prefix:
Example with cURL
Token Acquisition
Typical token acquisition flows:- OAuth 2.0 / OIDC: Obtain tokens from your identity provider (Keycloak, Auth0, etc.)
- Service Accounts: Use client credentials flow for machine-to-machine authentication
- User Login: Interactive login flow for human users
Token Format
Lamassu expects standard JWT tokens with the following characteristics: The JWT payload must include:Subject identifier (user or service account ID)
Expiration timestamp (Unix epoch seconds)
Issued-at timestamp (Unix epoch seconds)
Token Validation
The API server validates:- Signature: Verifies the JWT signature against configured public keys
- Expiration: Rejects expired tokens
- Issuer: Validates the token issuer matches expected IdP
- Audience: Ensures the token is intended for the API
Authentication Errors
Mutual TLS (mTLS) Authentication
Overview
Mutual TLS authentication is used for device enrollment and EST (Enrollment over Secure Transport) operations. This authentication method requires both the server and client to present valid X.509 certificates.When to Use mTLS
mTLS is primarily used for:- EST Enrollment: RFC 7030 compliant enrollment endpoints (
/.well-known/est) - Device Authentication: Device-to-platform secure communication
- Certificate Renewal: Authenticating renewal requests with existing certificates
EST Endpoints
The DMS Manager service provides EST endpoints that require client certificate authentication:Client Certificate Requirements
For successful mTLS authentication:Example with cURL
Example with OpenSSL
Certificate Validation
The server validates:- Certificate Chain: Client certificate must chain to a trusted root CA
- Certificate Validity: Current time within
notBeforeandnotAfterdates - Revocation Status: Certificate must not be revoked (CRL/OCSP check)
- Extended Key Usage: Certificate must have appropriate EKU for client authentication
mTLS Authentication Errors
Dual Authentication (EST)
Some EST operations support dual authentication where both JWT and mTLS can be used:Security Best Practices
Token Storage and Handling
Token Storage and Handling
- Never hardcode JWT tokens in source code
- Store tokens securely using environment variables or secret management systems
- Rotate tokens regularly (before expiration)
- Use short-lived tokens with refresh token mechanisms when possible
Private Key Protection
Private Key Protection
- Store private keys in hardware security modules (HSMs) when possible
- Use file permissions (e.g.,
chmod 400) to restrict key access - Never transmit private keys over insecure channels
- Consider using PKCS#11 or cloud KMS for key storage
Transport Security
Transport Security
- Always use HTTPS/TLS for API communication
- Verify server certificates to prevent man-in-the-middle attacks
- Use TLS 1.2 or higher
- Disable weak cipher suites
Token Validation
Token Validation
- Implement client-side token expiration checking
- Handle 401 errors gracefully with token refresh logic
- Monitor for authentication failures indicating potential security issues
Authentication Flow Examples
Standard Management Operations
EST Device Enrollment
Environment-Specific Configuration
Authentication configuration varies by environment:Troubleshooting
Common Issues
| Problem | Cause | Solution |
|---|---|---|
| 401 Unauthorized | Expired token | Refresh or obtain a new token |
| Token validation fails | Clock skew | Synchronize system clock with NTP |
| mTLS handshake failure | Incorrect certificate | Verify certificate matches expected CA |
| Certificate not trusted | Missing CA in trust store | Add CA certificate to trust store |
Debugging Tips
- Check Token Claims: Decode JWT at jwt.io to inspect claims
- Verify Certificate: Use
openssl x509 -in cert.pem -text -nooutto inspect certificate details - Test Connectivity: Use
curl -vfor verbose output showing TLS handshake - Check Logs: Review API server logs for detailed error messages
SDK Support
Official Lamassu SDKs handle authentication automatically:Next Steps
API Overview
Learn about base URLs and common patterns
Filtering & Sorting
Filter resources with JSONPath expressions
CA API
Start managing certificate authorities
Security Best Practices
Comprehensive security guidelines
