Authorization Errors
Getting a 401 Unauthorized when publishing or verifying pacts
The most common reasons for API authentication failures are:
-
Using an old version of Pact library that does not support the Swagger Contract Testing authentication scheme (bearer token authentication).
- To resolve this, make sure you are using the latest Pact library version for your language.
-
Attempting to access the API with a username and password instead of an API token.
- To resolve this, please see the section on configuring your API token
-
Using a read-only token instead of a read/write token
- To resolve this, please see the section on configuring your API token and ensure you have copied the read/write token.