Authentication overview
SEON's platform provides fraud prevention and digital identity verification services through its API. Authentication is a critical security measure that verifies the identity of the client application attempting to access these services, ensuring that data is exchanged securely and only with authorized parties. For SEON, this primarily involves the use of API keys, which act as unique identifiers and secret tokens for your account.
The SEON API is designed for server-to-server communication, where your backend systems send data to SEON for analysis and receive fraud scores or recommendations in return. This architecture minimizes the exposure of sensitive credentials on client-side applications. The API supports various data points, including email, phone, IP, and device fingerprinting, all of which contribute to a comprehensive risk assessment. Proper authentication is integral to maintaining the integrity and confidentiality of this data exchange, aligning with security best practices for API interactions Google Cloud API security guidelines.
SEON offers SDKs for common environments like JavaScript, Android, and iOS to facilitate integration, particularly for collecting device fingerprinting data. While these SDKs simplify data collection, the core authentication for API calls typically resides on the server-side, using the API keys obtained from the SEON Client Portal. This separation of concerns helps protect your credentials from client-side vulnerabilities.
Supported authentication methods
SEON primarily relies on API keys for authenticating requests to its fraud prevention platform. This method provides a straightforward yet effective way to control access to your account's API resources. Each API key is unique to your SEON account and acts as both an identifier and a secret token.
When an API request is made, the API key is included in the request headers, allowing SEON's servers to verify the sender's identity and authorize the operation. This ensures that only legitimate applications associated with your account can retrieve fraud scores, submit data for analysis, or manage configurations.
The following table outlines the primary authentication method supported by SEON:
| Method | When to Use | Security Level |
|---|---|---|
| API Key (HTTP Header) | Primary method for server-to-server API calls to SEON. Ideal for backend systems integrating fraud checks. | High (when securely managed and transmitted over HTTPS). |
Beyond the core API key authentication, SEON's system implicitly leverages HTTPS/TLS for all API communications. This encryption protocol secures data in transit, protecting both the API keys and the sensitive fraud-related data from interception or tampering as it travels between your application and SEON's servers. The importance of TLS/SSL for securing web traffic is a fundamental principle of internet security Mozilla's explanation of TLS.
Getting your credentials
To begin using the SEON API, you will need to obtain your API keys from the SEON Client Portal. These keys are unique to your account and grant access to your fraud prevention services. The process generally involves:
- Account Creation: If you don't already have one, sign up for a SEON account on their official website. You can typically start with a 14-day free trial to explore the platform's capabilities.
- Accessing the Client Portal: Once your account is set up, log in to the SEON Client Portal. This portal serves as your central hub for managing settings, reviewing analytics, and obtaining API credentials.
- Navigating to API Settings: Within the portal, locate the section related to API settings or integration. The exact path may vary but is typically found under 'Settings', 'Developers', or 'API Keys'. Refer to the official SEON authentication documentation for the most current navigation steps.
- Generating API Keys: You will find an option to generate new API keys. SEON typically provides different types of keys, such as 'API key' and 'API secret key', or distinct keys for different environments (e.g., development and production). It is crucial to understand the purpose of each key and use them appropriately. For example, the SEON Fraud API documentation specifies the use of an 'API Key' for authentication SEON Fraud API authentication details.
- Storing Keys Securely: Once generated, treat your API keys as sensitive credentials, similar to passwords. Do not hardcode them directly into your application's source code, commit them to version control systems, or expose them in client-side code. Instead, store them in environment variables, a secure configuration management system, or a secrets manager.
SEON's documentation provides specific instructions and examples for handling these keys, including how to pass them correctly in API requests. Always consult the SEON developer documentation for the most accurate and up-to-date guidance on credential management.
Authenticated request example
When making an authenticated request to the SEON API, your API key must be included in the HTTP headers. The specific header name is typically X-API-KEY or similar, as defined in the SEON API reference. Below is an example using cURL, demonstrating how to make an authenticated request to the SEON Fraud API for an email analysis:
curl -X POST \
'https://api.seon.io/email-api/v2.2/' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: YOUR_API_KEY_HERE' \
-d '{ "email": "[email protected]" }'
In this example:
-X POSTspecifies the HTTP method as POST.'https://api.seon.io/email-api/v2.2/'is the endpoint for the Email API.-H 'Content-Type: application/json'indicates that the request body is in JSON format.-H 'X-API-KEY: YOUR_API_KEY_HERE'is the critical authentication header. ReplaceYOUR_API_KEY_HEREwith your actual API key obtained from the SEON Client Portal.-d '{ "email": "[email protected]" }'is the JSON payload containing the data to be analyzed.
For integrations using SEON's SDKs, the authentication process might be abstracted, but it still relies on securely configured API keys. For instance, in a Python application, you might use a library to handle the HTTP request and header injection:
import requests
import os
# It's recommended to store your API key in an environment variable
api_key = os.environ.get("SEON_API_KEY")
if not api_key:
raise ValueError("SEON_API_KEY environment variable not set.")
url = "https://api.seon.io/email-api/v2.2/"
headers = {
"Content-Type": "application/json",
"X-API-KEY": api_key
}
payload = {
"email": "[email protected]"
}
try:
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status() # Raise an HTTPError for bad responses (4xx or 5xx)
print("Response:", response.json())
except requests.exceptions.HTTPError as err:
print(f"HTTP error occurred: {err}")
except Exception as err:
print(f"An error occurred: {err}")
This Python example demonstrates fetching the API key from an environment variable, which is a recommended security practice. Always refer to the SEON quickstart guide for language-specific examples and detailed integration instructions.
Security best practices
Securing your API integration with SEON is crucial for protecting sensitive data and maintaining the integrity of your fraud prevention efforts. Adhering to these best practices will help mitigate common security risks:
- Protect your API Keys:
- Environment Variables: Store API keys in environment variables rather than hardcoding them directly into your application's source code. This keeps them out of version control systems and makes them easier to manage across different environments (development, staging, production).
- Secrets Management: For more complex deployments, use a dedicated secrets management service (e.g., AWS Secrets Manager, Google Secret Manager, Azure Key Vault, HashiCorp Vault) to store and retrieve your API keys securely.
- Access Control: Restrict access to API keys to only those individuals and systems that absolutely require them. Implement strict access control policies.
- Use HTTPS/TLS for all Communications:
- All communication with the SEON API should occur over HTTPS (HTTP Secure). This encrypts data in transit, protecting your API keys and sensitive fraud data from eavesdropping and man-in-the-middle attacks. SEON endpoints enforce HTTPS, ensuring this layer of security.
- Implement Key Rotation:
- Regularly rotate your API keys. This practice minimizes the risk exposure if a key is compromised. If a key is leaked, rotating it renders the old key inactive, preventing further unauthorized access. SEON's Client Portal provides options for generating new keys and revoking old ones.
- Monitor API Usage:
- Regularly review your API usage logs within the SEON Client Portal. Unusual spikes in activity, requests from unexpected IP addresses, or a high volume of failed authentication attempts could indicate a security incident.
- Error Handling and Logging:
- Implement robust error handling in your application to gracefully manage authentication failures. Avoid exposing detailed error messages that could reveal sensitive information to potential attackers. Log authentication attempts and failures, but ensure logs do not contain the API keys themselves.
- Principle of Least Privilege:
- If SEON offers different types of API keys with varying permissions (e.g., read-only vs. read/write), use the key with the minimum necessary privileges for a given task. This limits the potential damage if a key is compromised.
- Secure Client-Side Implementations:
- While core API calls with sensitive keys should be server-side, SEON's SDKs for client-side data collection (e.g., device fingerprinting) should also be integrated securely. Ensure your client-side code is minified, obfuscated, and protected against tampering where possible. Avoid embedding any sensitive credentials directly in client-side code bundles.
- Stay Updated:
- Keep your SEON SDKs and any related libraries up to date to benefit from the latest security patches and features. Regularly review SEON's release notes and security advisories.
By diligently applying these security practices, you can establish a strong and resilient integration with the SEON platform, safeguarding your operations against fraud and unauthorized access.