# Setting Up Authorization

**URL:** <https://community.postman.com/t/setting-up-authorization/668>\
**Category:** Help Hub\
**Created:** [January 11, 2018, 10:01pm UTC](https://community.postman.com/t/setting-up-authorization/668 "2018-01-11T22:01:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucasisola](https://avatars.discourse-cdn.com/v4/letter/l/a5b964/32.png) [@lucasisola](https://community.postman.com/u/lucasisola)\
**Post date:** [January 11, 2018, 10:01pm UTC](https://community.postman.com/t/setting-up-authorization/668/1 "2018-01-11T22:01:51Z")

</div>

Hi Community! New Postman user, semi-technical so be kind 😄

I’m having trouble setting up my Authorization for my tests. I’m getting a token expired response for my GETs and POSTs but I know the token generated isn’t expired.

I’m just trying to get my Authorization to use the Bearer token we generate from our GET /token endpoint for each new call.

We have an endpoint where we perform a GET to receive a Bearer Token. The response looks like this:  
{“token”:“eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6Ijg2ZTEwYjM4LTFiZDYtNGFiNC04YjlmLTVhNmI4ZDg3MjRmNSIsIm5iZiI6MTUxNTcwNzg1MiwiZXhwIjoxNTE1NzA5MDUyLCJpYXQiOjE1MTU3MDc4NTJ9.hGblCa8kyoeO9QaAPbKylIVxOkrZGxKxhqrt9Um1cAQ”,  
“expiresAt”: “2018-01-11T22:17:32.8517349Z”}

In the **Edit Collection** section, I have the Authorization setup to use **results from GET /token…**. I have a feeling this is where my mistake is.

 ![35 PM](https://us1.discourse-cdn.com/getpostman/original/3X/e/d/ed73edaba2ca53ffe32209f99e17d6b00a73c1f3.png)

When I use a GET that uses the Collection-level authorization, I’m not getting the right token.

```
GET /v1/api/contact?id=WZzl HTTP/1.1
Host: hidden host name
Ocp-Apim-Subscription-Key: 2ace9fd1e8ac4d448e179b5d069f2c81
Authorization: Bearer "token" from GET /token.....
Cache-Control: no-cache
Postman-Token: 891004f1-68cf-51ec-0eac-048998d80598

```

---

<div class="post-metadata">

**Author:** ![abhijitkane1](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/abhijitkane1/32/4_2.png) [@abhijitkane1](https://community.postman.com/u/abhijitkane1)\
**Post date:** [January 15, 2018, 9:32am UTC](https://community.postman.com/t/setting-up-authorization/668/2 "2018-01-15T09:32:56Z")

</div>

Hi @lucasisola - you’ll need to copy and paste the actual token into the Token box. Alternatively, you can use a variable in the authorization box: {{token}}, and use this in the test script of your GET request:

`pm.globals.set("token", pm.response.json().token);`

---

<div class="post-metadata">

**Author:** ![lucasisola](https://avatars.discourse-cdn.com/v4/letter/l/a5b964/32.png) [@lucasisola](https://community.postman.com/u/lucasisola)\
**Post date:** [January 17, 2018, 3:30pm UTC](https://community.postman.com/t/setting-up-authorization/668/3 "2018-01-17T15:30:12Z")

</div>

Thanks! @abhijitkane1. I really appreciate your reply!! 😀
