Skip to content

← All questions

I use no authentication still sends the bearer token — my 401 assertion gets a 200

Asked 7,920 views3 answers

Deny-direction scenario, as plain as it gets:

gherkin
@api @regression
Scenario: The admin list is refused to an anonymous caller
  Given I use no authentication
  When I send a GET request to "/admin/users"
  Then the response status should be 401
text
Expected: 401
Received: 200

The endpoint does deny anonymous callers — I checked with curl. Our envs/staging.yaml has:

yaml
api:
  auth: { type: bearer }

and if I remove that block the scenario passes. So the step is not clearing anything. What is I use no authentication supposed to do?

asked by Gio Castellano521 ·

3 answers

Have the same question?

Ask it with the command you ran and the output you got, and it will be answered here.

Ask a question

Related