# Token Authorization flow

**URL:** https://discourse.nodered.org/t/token-authorization-flow/35715
**Category:** General
**Created:** [11 November 2020 03:08 UTC](https://discourse.nodered.org/t/token-authorization-flow/35715 "2020-11-11T03:08:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Tico](https://avatars.discourse-cdn.com/v4/letter/t/a88e57/32.png) [@Tico](https://discourse.nodered.org/u/Tico)
#### Post date: [11 November 2020 03:08 UTC](https://discourse.nodered.org/t/token-authorization-flow/35715/1 "2020-11-11T03:08:17Z")

</div>

Please refer to the attached screenshot -

> **[Authorisation flow.png](https://drive.google.com/file/d/1rQ0KYhwwsWjPKiHc5AwFgT6Xtp6PQbbj/view)**
>
> Google Drive file.

The top line is a successful HTTP POST request that returns an IDToken. The IDToken needs to be used in a subsequent HTTP GET request to retrieve the data I require.

The attached screenshot is my ham-fisted attempt at trying to put the IDToken where it needs to be in the 'Authorization' field of the GET request. I really have no idea what I'm doing trying to re-engineer examples I've found on the web.

I can successfully (manually) copy and paste the IDToken where it needs to be in the brackets ' + bearer + ' and the flow returns the required data.

Any suggestions how to do this?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [11 November 2020 07:30 UTC](https://discourse.nodered.org/t/token-authorization-flow/35715/2 "2020-11-11T07:30:29Z")

</div>

hi  
have you tried removing the ' and + frorm around ' + bearer +'.  
i.e  
`msg.headers['authorization'] = bearer;`

---

<div class="post-metadata">

### Author: ![Tico](https://avatars.discourse-cdn.com/v4/letter/t/a88e57/32.png) [@Tico](https://discourse.nodered.org/u/Tico)
#### Post date: [11 November 2020 08:15 UTC](https://discourse.nodered.org/t/token-authorization-flow/35715/3 "2020-11-11T08:15:28Z")

</div>

Thankyou! That works fine. I guess there's some reason why the examples I tried to adapt used the format ' + bearer + '. Learning curve...steep...struggling. 🤔

Cheers.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [10 January 2021 08:15 UTC](https://discourse.nodered.org/t/token-authorization-flow/35715/4 "2021-01-10T08:15:28Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
