72

I want to set a Bearer Token in postman

For some reason my Postman doesn't have the Bearer Token option in the Auth dropdown

What can I do in Postman to show that option? Any ideas where I can find it? Regards.

Heniam
  • 68
  • 16
David
  • 1,035
  • 1
  • 7
  • 11
  • 3
    You need to install the latest version. I had the same issue in 5.3 and updated to the latest 6.3 and fix my problem. – Kapila Perera Sep 27 '18 at 10:01
  • 1
    Or you are using google chrome extension version, it is deprecated... New features are not available in it. – Aderemi Dayo Jun 07 '19 at 10:55
  • You can even change the word Bearer, in cases where you want to use `Token token` - https://github.com/postmanlabs/postman-app-support/issues/4727#issuecomment-775977045 – Tiago Martins Peres Apr 26 '22 at 10:58

8 Answers8

131

I'm not sure if those 2 images are from the same Postman application or not but the Bearer Token feature only came in on version 5.3.0.

You can just manually add an Authorization Request Header with a Bearer <my_token> value.

This is just a dummy value for demo purposes - The actual value should be Bearer + your token value.

Auth Header

That should work without the need to use that option from the drop down list. This would only just replicate automatically, what you would be doing manually anyway.

Danny Dainton
  • 23,069
  • 6
  • 67
  • 80
  • But my postman extension version is `5.5.4`, it is still does not have `Bearer Token` type, is that version is different for it's browser Extension or Desktop app – Aria Jan 17 '20 at 11:17
  • 1
    The browser extension is now deprecated. The desktop app is what you would need to be using and this is currently at 7.16.0 so many versions ahead the old extension. – Danny Dainton Jan 17 '20 at 11:33
44

I am using Postman v7.0.9.

Add accessToken variable to postman environmental variable.

enter image description here

Then use Tests tab to write javascript.

enter image description here

let jsonData = pm.response.json();
let token = jsonData.accessToken;
pm.environment.set('accessToken', token);

If you are usign the current version "Bearer Token" type is under Authorization tab.

enter image description here

Cihangir
  • 1,892
  • 1
  • 11
  • 16
7

You have a some options to add authorization type:

1) Go headers tap and add => key: Authorization value:Bearer

2) Create collection > select authorization

3) click code and add headers

enter image description here

headers:
{
  'Postman-Token': '55..',
  'cache-control': 'no-cache',
  'Authorization': 'Bearer eyJhbG...'
}
Robson
  • 813
  • 5
  • 21
  • 40
het
  • 781
  • 9
  • 16
6

Feb, 2021 - Following worked for me

From the type, choose 'Bearer Token'.

Enter Token in the field as shown below in screenshot:

enter image description here

Rajeev Jayaswal
  • 1,423
  • 1
  • 20
  • 22
6

Add manually in Header, Key as Authorization and Value as Bearer + space then your token like the below snapshot.

enter image description here

Abdul Khaliq
  • 2,139
  • 4
  • 27
  • 31
1

The problem is with Postman with Chrome or Chrome extension of Postman, It doesn't have more authorization options.

So Just download the new postman app, it has more features and you will get the Bearer Token option too.

n-verbitsky
  • 552
  • 2
  • 9
  • 20
DIVYANSHU SAHU
  • 1,035
  • 11
  • 24
0

Suppose your auth request url is ../authentication/v1/login and it responses with some json as:

},
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1N.....

and you want to send the token to your server .../service/hello request

Steps:

  1. in the /public/authentication/v1/login in 'Tests' folder put:

    let jsonData = pm.response.json();

    let token = jsonData.token;

    pm.environment.set('myToken', token);

  2. in ../service/hello in the 'Authentication' folder select 'Bearer Token' and in 'Token' field put {{myToken}}

TEST it

  1. send POST ../authentication/v1/login (usin the SEND button)
  2. check the 'Environment quick look' examine 'myToken' field value
  3. in ../service/hello request hover above {{myToken}} - you will see the current value

The 'myToken' will be sent automatically with your server call.

by yl.

ylev
  • 2,313
  • 1
  • 23
  • 16
-1

I faced this problem a long time ago. And I solved this problem by installing the Desktop version and again login with Google account. After that Bearer Token visible in postman!

In my case, I used Windows 8.1 and 64 bit.

here you can get the desktop version