Bearer token in postman

后端 未结 4 2083
眼角桃花
眼角桃花 2021-02-06 21:40

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

相关标签:
4条回答
  • 2021-02-06 22:17

    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

    0 讨论(0)
  • 2021-02-06 22:18

    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.

    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.

    0 讨论(0)
  • 2021-02-06 22:26

    I am using Postman v7.0.9.

    Add accessToken variable to postman environmental variable.

    Then use Tests tab to write javascript.

    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.

    0 讨论(0)
  • 2021-02-06 22:27

    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

    headers:
    {
      'Postman-Token': '55..',
      'cache-control': 'no-cache',
      'Authorization': 'Bearer eyJhbG...'
    }
    
    0 讨论(0)
提交回复
热议问题