Newbie here: modify bearer token prefix in collection auth

My question:

I know how to set up my auth in single http request but I want to use the folder/collection feature for auth. However I am authorizing using a bearer token with a modified prefix (ie. JWT <token>) and I can easily type in that JWT prefix before the token in a single request, just can’t find it in the folder level auth.

Details (like screenshots):

I can use this just fine in single request:

but I want to set it up for the folder or collection level and not have the prefix be Bearer but rather be JWT:

1 Like

I think I might be ok with this workaround, maybe this is common knowledge for others, or maybe other newbies can benefit from it so I’ll leave this up:

I did just realize from more playing around that if I put the JWT {{token}} on every request in the folder, I can just run the pre-request script (on the folder level) and set ‘token’ to the auth token I have created through our auth/sso process.

1 Like

Other newbies, and experienced users alike, will certainly benefit from knowledge you’ve gained the hard way. Thanks for sharing and leaving this up @stajah – and welcome to the Postman community!

2 Likes

You can set an API Key in the collection

  • Select Header in the “Add to” option
  • Set “Key” to Authorization
  • Set “Value” to the expected header value (e.g. JWT ey...)

It’s a good practice to parametrize sensitive data, so you can use a variable in “Value” (like in the picture below).

Variables can be set in the “Variables” Collection’s tab and aren’t taken into account when collection is shared.