API authentication
For secure communication between your client and the Veracode APIs, you can configure Open Authorization (OAuth) Client authentication or Hash-based Message Authentication Code (HMAC) signing using your Veracode API credentials. This security measure provides protection against man-in-the-middle and session replay attacks when using the APIs from a command line or in code.
Prerequisites
To set up API authentication, you must have API credentials. For HMAC authentication, we recommend storing your HMAC credentials in an API credentials file.
Using the API wrappers
For HMAC authentication, the API wrappers are preconfigured with HMAC signing enabled. After creating and storing your HMAC credentials, you can use the Java or C# wrappers from the command line or in your code.
OAuth authentication isn't supported.
Using the REST APIs
For HMAC authentication:
- Perform the external signing step on the command line using either the Java or Python tool or the Veracode API wrappers.
- Use one of the Community-provided HMAC implementations.
- Install a Veracode authentication library and configure your code or development tools to use your API credentials to apply HMAC signing to API requests.
For OAuth authentication, see set up API authentication.
Using the XML APIs
For HMAC authentication:
- Use HTTPie to set up the Python authentication library.
- Use one of the Community-provided HMAC implementations.
For OAuth authentication, see set up API authentication.
Using API tools and platforms
If you're using an API tool, such as Postman, Insomnia, or cURL, you can configure your Veracode API credentials (ID and secret key pair) as environment variables. To add HMAC credentials to an environment in Postman, see the REST APIs quickstart. If you use HMAC authentication, we recommend storing your credentials in an API credentials file.
Troubleshooting
If you see authentication errors when using the Veracode APIs, see Authentication errors for the error messages and recommended actions. To test your access, send a request to the APIs. You should get a quick response.
For help with HMAC or OAuth authentication, contact Veracode Technical Support at [email protected].