pact-foundation / pact-jvm

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://docs.pact.io
Apache License 2.0
1.08k stars 479 forks source link

How to add authentication token during pact-verification process when getting contract file in clojure #1731

Open prabhleen18 opened 10 months ago

prabhleen18 commented 10 months ago

I am trying to get the contract file in order to verify pact with the provider in clojure. Since we are using pactflow we need to authenticate with the bearer token. We are doing the following but it is not working.:

:consumerA{ :pact-source "https://company.pactflow.io/pacts/provider/providerA/consumer/consumerA/latest" :auth {:token "auth-token"} }

We are getting the following error : Error encountered performing task 'pact-verify' with profile(s): 'pact' InvalidHttpResponseException(message=Request to source 'UrlSource(url=https://company.pactflow.io/pacts/provider/providerA/consumer/consumerA/latest, pact=null)' failed with response 'HTTP/1.1 401 Unauthorized')

Version used: au.com.dius.pact.provider/lein "4.1.42" Can you please support here

rholshausen commented 10 months ago

Just confirming, "auth-token" is replaced with your actual auth token?