[Bug] Cannot override Collection Basic Auth with request specific Bearer Token
I have a collection with Auth set to Basic Auth:
In the collection there is a GET Request, which has a Bearer Token auth:
When I execute the request and observe the "Timeline" tab on the right, I see that it still uses the Basic Auth credentials:
I would expect that it will use the Bearer Token Auth specified in the request.
If I disable the Collection Auth (set it to No Auth), then the request correctly uses the Bearer Token auth:
I am using Bruno v1.1.1
You can fix this by using the Collection's Headers tab and add a Authorization header while setting its value to:
Bearer {{accessToken}}
Then every request inside of this collection will use that same header for its authentication. This is not the most ideal solution but fortunately others have voiced this issue too in #816 and it should be fixed in #907.
@kpau if you're able, please try out my feature branch https://github.com/btgs-0/bruno/tree/feature/auth-from-collection and let me know if it works for you
@n00o , Thanks for the info. But my issue is a bit different compared to #816. I understand that No Auth uses Collection auth, but in my case I am explicitly setting another type of Auth and it is still using the Collection auth. The issues are related so the root cause might be the same.
@btgs-0 , Thanks for the PR. If I have time today, I'll test the branch.
Even if the issue is fixed with this PR, it is good to have both issues documented for future reference.
Edit: I tested the PR and it resolves my issue. Thanks!
thanks for testing my PR @kpau. And thanks @n00o for connecting the dots, my PR incidentally fixes this issue by making the collection auth inheritance explicit
It appears that https://github.com/usebruno/bruno/pull/1667 addresses this by explicit requirement of inheritance.
Closing this issue as the PR implementing the feature has already been merged. Check out this https://github.com/usebruno/bruno/issues/816#issuecomment-2202065577 comment demonstrating the PR's behavior.