Troubleshoot API credentials
If you see authentication errors when using Veracode products with Veracode API credentials, follow these troubleshooting steps.
Using API credentials with the Veracode Scan IDE plugins
When using the Veracode Scan IDE plugins to authenticate with Veracode, the plugins prioritize your API credentials in the following order:
- Environment variables: if
VERACODE_API_KEY_IDandVERACODE_API_KEY_SECRETare set, the IDE plugin uses the credentials defined for these variables first. veracode.yml(Veracode CLI configuration): if environment variables for your credentials don't exist and you have authenticated with theveracode configureCLI command, the IDE plugin uses the credentials in theveracode.ymlfile located in~/.veracode.- API credentials file: if the IDE plugin can't find the first two options, it uses the credentials stored in your API credentials file, which is typically located at
~/.veracode/credentials.
Verify your API credentials
The following steps apply to both HMAC credentials and OAuth Client Credentials.
- Close any applications, such as your IDE or CLI console, and stop any services that are currently using your API credentials.
- Ensure your API credentials are valid and haven't expired. To check the status of your credentials, use the Veracode Platform, run a simple CLI command, or send a simple API request. Some integrations, such as IDE plugins and Jira, support checking the status from within their UIs.
- If your credentials have expired, you can generate new credentials for HMAC or OAuth Client authentication.
- After generating new credentials, add them to your authentication configuration, such as environment variables or your API credentials file.
- Optionally, if you're using the Veracode Scan IDE plugins, and you have authenticated with Veracode using the Veracode CLI (HMAC or OAuth Client), remove the
veracode.ymlfile from yourhomedirectory. See Using API credentials with the Veracode Scan IDE plugins. - Restart your applications or services to apply your updated credentials. Then, verify that you can authenticate with Veracode.
- If you continue to see authentication errors, review the resolutions for authentication errors.
Verify your OAuth Client Credentials
If you authenticate with Veracode using OAuth Client Credentials, and you're seeing authentication errors, use the following steps to verify your credentials.
- Close any applications, such as your IDE or CLI console, that are currently using your OAuth Client Credentials.
- In your web browser, clear all authentication cookies and cache.
- If you have an existing API credentials file (HMAC only) but only use OAuth Client Credentials, delete the API credentials file.
- Verify that the OAuth callback URL matches your integration configuration.
- Optionally, if you're using the Veracode Scan IDE plugins, and you have authenticated with Veracode using the Veracode CLI, remove the
veracode.ymlfile from yourhomedirectory. See Using API credentials with the Veracode Scan IDE plugins. - Restart your applications or services to apply your updated credentials. Then, verify that you can authenticate with Veracode.
- If you continue to see authentication errors, review the resolutions for authentication errors.
Verify your API credentials file
If you authenticate with Veracode using HMAC credentials stored in an API credentials file, and you're seeing authentication errors, use the following steps to verify your credential file.
-
Close any applications, such as your IDE or CLI console, that are currently using your API credentials file.
-
Open your credentials file in a text editor.
On Windows:
%USERPROFILE%\.veracode\credentialsOn macOS or Linux:
~/.veracode/credentials -
Review the credentials file and ensure that it's configured and formatted correctly, contains valid credentials, and is in the required location.
-
Verify that you have both read and write permissions for the
.veracodedirectory and thecredentialsfile.On macOS or Linux, run the following commands to set the required permissions:
chmod 700 ~/.veracodechmod 600 ~/.veracode/credentials -
Optionally, if you're using the Veracode Scan IDE plugins, and you have authenticated with Veracode using the Veracode CLI, remove the
veracode.ymlfile from yourhomedirectory. See Using API credentials with the Veracode Scan IDE plugins. -
Restart your applications or services to apply your updated credentials. Then, verify that you can authenticate with Veracode.
-
If you continue to see authentication errors, review the resolutions for authentication errors.