Authentication overview
Suprsonic provides a unified platform for managing and orchestrating API integrations. To ensure secure and authorized access to its services, Suprsonic supports multiple authentication methods tailored for different integration scenarios. These methods are designed to protect data integrity and confidentiality when interacting with the Suprsonic API, configuring integrations, or receiving real-time updates via webhooks. The choice of authentication method depends on the specific use case, such as programmatic access by a backend service, user authorization for third-party applications, or secure receipt of event notifications.
Developers integrate with Suprsonic either by sending requests to the Suprsonic API or by receiving data from Suprsonic via webhooks. Each interaction requires a corresponding authentication or verification mechanism. Establishing secure connections is a fundamental aspect of building reliable and compliant API integrations, aligning with broader industry standards for API security such as those outlined by the IETF's OAuth 2.0 framework.
Supported authentication methods
Suprsonic offers several authentication and verification methods to accommodate various integration architectures and security requirements. Understanding when to apply each method is crucial for designing secure and efficient API workflows.
API Keys
API keys are unique identifiers used to authenticate an application or user when interacting with the Suprsonic API. They are typically used for server-to-server communication or when an application needs to access Suprsonic on its own behalf. An API key grants access to specific functionalities or resources within the Suprsonic platform, as defined by its associated permissions. Suprsonic API keys are generally long, randomly generated strings that should be treated as sensitive credentials.
OAuth 2.0
OAuth 2.0 is an authorization framework that enables third-party applications to obtain limited access to an HTTP service, either on behalf of a resource owner or by orchestrating an API interaction with the resource owner's authorization. Suprsonic utilizes OAuth 2.0 for scenarios where a user grants a third-party application permission to access their Suprsonic account data without sharing their actual Suprsonic credentials. This method provides a more secure and granular approach to delegated authorization compared to simple API keys for user-centric applications.
For more details on the OAuth 2.0 process, including authorization grants and token management, developers can refer to the official OAuth 2.0 specification.
Webhook Signatures
When Suprsonic sends event notifications to an external endpoint via webhooks, it includes a digital signature in the request headers. This signature allows the receiving application to verify that the webhook payload originated from Suprsonic and has not been tampered with in transit. Webhook signatures are typically generated using a shared secret and a cryptographic hash function, ensuring the integrity and authenticity of the received data.
Verifying webhook signatures is a critical security measure against spoofing and data manipulation, similar to how platforms like Stripe recommend verifying webhook events.
| Method | When to Use | Security Level |
|---|---|---|
| API Keys | Server-to-server communication, programmatic access where user context is not required. | Medium (depends on key management, typically offers specific scope permissions). |
| OAuth 2.0 | Delegated authorization; when a user grants a third-party app access to their Suprsonic data. | High (token-based, temporary access, user consent required). |
| Webhook Signatures | Verifying the authenticity and integrity of incoming webhook payloads from Suprsonic. | High (cryptographically ensures sender identity and data integrity). |
Getting your credentials
Accessing Suprsonic's authenticated features requires obtaining the appropriate credentials from your Suprsonic account dashboard. The specific steps vary depending on the authentication method you choose:
For API Keys
- Log in to your Suprsonic account dashboard.
- Navigate to the 'API Keys' or 'Integrations' section.
- Generate a new API key. You may be prompted to associate it with specific permissions or environments (e.g., development, production).
- Copy the generated API key immediately. Suprsonic typically displays the key only once for security reasons.
- Store your API key securely, following recommended security best practices.
For OAuth 2.0 (Client ID and Client Secret)
- Log in to your Suprsonic account dashboard.
- Go to the 'Applications' or 'OAuth Clients' section.
- Register a new application. You will need to provide details such as the application name, redirect URIs, and potentially a logo or description.
- Upon registration, Suprsonic will provide you with a Client ID and a Client Secret.
- The Client ID is public and identifies your application. The Client Secret must be kept confidential and is used by your application's backend to authenticate with Suprsonic's authorization server.
- Record both the Client ID and Client Secret securely.
For Webhook Signing Secrets
- Within your Suprsonic account, navigate to the 'Webhooks' or 'Integrations' settings.
- When configuring a new webhook endpoint, Suprsonic will generate a unique signing secret for that endpoint.
- This secret is crucial for verifying the authenticity of incoming webhook payloads.
- Copy and securely store this signing secret in your application's environment variables or secure configuration store.
For detailed, step-by-step instructions on credential generation, refer to the Suprsonic authentication documentation.
Authenticated request example
Below is an example of an authenticated request using an API key, which is a common method for server-to-server interactions with Suprsonic. This example uses cURL, a widely available command-line tool, but the principle applies across various programming languages and SDKs (JavaScript, Python, Ruby, Go, PHP) supported by Suprsonic.
In this example, YOUR_API_KEY should be replaced with an actual API key obtained from your Suprsonic dashboard, and /your-endpoint with the specific Suprsonic API endpoint you intend to access. The API key is typically sent in the Authorization header using the Bearer scheme.
curl -X GET \
'https://api.suprsonic.io/v1/your-endpoint' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json'
When using OAuth 2.0, after obtaining an access token, it would be used similarly in the Authorization: Bearer header. Suprsonic provides API reference documentation with code examples for its supported SDKs to guide developers through authenticated requests in their preferred language.
Security best practices
Adhering to security best practices is essential when managing and using Suprsonic credentials to prevent unauthorized access and maintain the integrity of your integrations.
Credential Management
- Do not hardcode credentials: Avoid embedding API keys, client secrets, or webhook secrets directly in your source code. Use environment variables, secure configuration files, or secret management services.
- Rotate credentials regularly: Periodically generate new API keys and secrets, and revoke old ones. This minimizes the impact of a compromised credential.
- Restrict IP access: If supported, configure API keys to only be accessible from a specific set of trusted IP addresses.
- Use least privilege: Grant credentials only the minimum necessary permissions to perform their intended function. For example, an API key used only for reading data should not have write permissions.
Secure Communication
- Always use HTTPS: Ensure all communications with the Suprsonic API occur over HTTPS to encrypt data in transit and prevent eavesdropping. Suprsonic endpoints enforce HTTPS.
- Validate webhook signatures: Always verify the signature of incoming webhooks to confirm they originate from Suprsonic and have not been tampered with.
Error Handling and Logging
- Avoid logging sensitive data: Do not log API keys, access tokens, or other sensitive credentials in application logs.
- Implement robust error handling: Properly handle authentication failures and other API errors without exposing sensitive information to end-users or logs.
- Monitor for suspicious activity: Regularly review API access logs for unusual patterns or failed authentication attempts that could indicate a security incident.
Application Security
- Input validation: Validate all input received from Suprsonic webhooks or API responses to prevent injection attacks or unexpected behavior.
- Secure storage: If your application stores Suprsonic-related tokens (e.g., OAuth refresh tokens), ensure they are encrypted at rest.
By implementing these practices, developers can significantly enhance the security posture of their Suprsonic integrations and protect against common vulnerabilities. For further guidance on secure development, consult resources like the OWASP API Security Top 10.