-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
usePreemptiveAuthentication doesn't work as expected #1764
Labels
bug
Indicates an unexpected problem or unintended behavior
smartbear-supported
SmartBear engineering team will support this issue. See https://docs.pact.io/help/smartbear
Comments
How are you setting the username and password? |
rholshausen
added
the
smartbear-supported
SmartBear engineering team will support this issue. See https://docs.pact.io/help/smartbear
label
Jan 31, 2024
I'm running tests with Spring, so in the test I have: @ExtendWith(SpringExtension.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@Provider("some-provider-name")
@PactBroker
class ClassUnderTest {
...
} and the properties for the pactbroker:
url: ${PACT_BROKER_URL:http://localhost:9292}
auth:
username: ${PACT_BROKER_USERNAME:pact}
password: ${PACT_BROKER_PASSWORD:pact} Nothing more. All these properties are read fine and everything works okay when |
4.6.6 has been released with a fix for this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Indicates an unexpected problem or unintended behavior
smartbear-supported
SmartBear engineering team will support this issue. See https://docs.pact.io/help/smartbear
usePreemptiveAuthentication property doesn't work as expected
Steps to reproduce:
pact.pactbroker.httpclient.usePreemptiveAuthentication="true"
Results:
I think the crucial logs are:
which confirms, that the property was read correctly and:
which tells that the underlying Apache HTTP client doesn't use the username and password set in Pact config (or it expects to find the credentials for this particular thing in other place than Pact sets).
Same thing happens if I use a remotely deployed Pact Broker and not the one running on a localhost, so that's not the reason here.
If the property is set to false, then the non-preemptive flow is executed correctly and the username and password are used just fine in the second try, so they are loaded correctly.
Dependency used:
au.com.dius.pact.provider:junit5spring:4.6.5
(the latest as of today)Excerpt from logs:
The text was updated successfully, but these errors were encountered: