-
Notifications
You must be signed in to change notification settings - Fork 234
How to authenticate to the Provider target endpoint ? #540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Have you seen https://docs.pact.io/provider/handling_auth? There are some helpful tips on approaches here. To clarify, do you want to authenticate to your Provider API, or the pact URI? i.e. is the |
Yeah so the issue we have found is that we are able to run the consumer test and generate the json file and we are able to run the provider test and it worked but that was when the endpoint was set to allow anonymous, but once we set up the endpoint to require authentication, the consumer test still works but the provider test fails now betting a 401 error. |
I was able to solve it, I will let you guys know on a next comment. |
You can use the I prefer to disable auth in the tests personally, but that feature is there in case you'd rather leave it on. |
Yeah that was part of the solution too. I also understand that the Authorization bearer should part of the header and it would be part of pact as well. I will close this ticket, thanks. |
Uh oh!
There was an error while loading. Please reload this page.
Version information:
Describe the bug
Not a bug but I'm not being able to pass Authorization with a Bearer to the header of the Pact Uri
Steps To Reproduce
I have a pact verifier, I need to be able to authenticate to the Provider Uri.
httpVerifier.WithHttpEndpoint(providerUri)
Then I'm calling
Verify()
methodLog Output
I'm getting 401
Could you guys help me to understand what I'm missing ?
The text was updated successfully, but these errors were encountered: