Hello, I'm having provider authorization problem w...
# pact-jvm
z
Hello, I'm having provider authorization problem with pact 4.3.14 I've added the authorization in the following method. However, it fails with the following message:
expected status of 200 but was 401
Copy code
@TestTemplate
  @ExtendWith(PactVerificationInvocationContextProvider.class)
  void pactVerificationTestTemplate(PactVerificationContext context, HttpRequest request){
    request.addHeader("Authorization", "Bearer a_valid_jwt_token");

    context.verifyInteraction();
  }
Thanks in advance.
m
I’d suggest enabling debug level logs to see if Pact is passing it through. If you can log in your auth API that would help also
z
Ok, trying
Thanks for your quick reply. I've found the problem. In the
application.yml
file I have the following entries with different
issuer
value.
Copy code
security:
    oauth2:
      resourceserver:
        jwt:
          issuer-uri: 

okta:
  oauth2:
    issuer: 
    client-id: 
    client-secret:
We don't need both of them. It actually confusing. So I removed the above one.
👍 1