Authorization Errors

Getting a 401 Unauthorized when publishing or verifying pacts

The most common reasons for API authentication failures are:

  1. Using an old version of Pact library that does not support the API Hub for Contract Testing authentication scheme (bearer token authentication).

    • To resolve this, make sure you are using the latest Pact library version for your language.

  2. Attempting to access the API with a username and password instead of an API token.

  3. Using a read-only token instead of a read/write token

Publication date: