Skip to content
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

Authorization headers are ignored #93

Open
osechet opened this issue Jan 3, 2024 · 1 comment
Open

Authorization headers are ignored #93

osechet opened this issue Jan 3, 2024 · 1 comment

Comments

@osechet
Copy link

osechet commented Jan 3, 2024

Hello,
I'm trying to test successive queries that use JWT. The first query generate a token that must be passed as an "Authorization: Bearer" to the following queries. Here is an example of what I do:

login:
  url: https://localhost:8443/api/v1/login
  method: POST
  headers:
    Accept: application/json
    Content-Type: application/json
  body: |-
    {
      "username": "user1",
      "password": "password1"
    }

listFeatures:
  url: https://localhost:8443/api/v1/features
  method: GET
  headers:
    Authorization: Bearer ${@login.response.body.token}

The second query always failed because the Authorization header is removed from the actual run (notice the headers: {}):

listFeatures:  # 1/3/2024, 16:52:26:528
  request:
    url: https://localhost:8443/api/v1/features
    method: GET
    headers: {}
…

What did I miss?

@donaldoakes
Copy link
Collaborator

Your syntax is correct. The Authorization header is redacted from console output and from actual results. In your scenario, if the response body contains a token property, it should be included in the listFeatures request's Authorization header. If you have a way of checking what the target API receives at the server, you should be able to confirm this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants