# Passing token from the oauth2 node to http request using function node

**URL:** <https://discourse.nodered.org/t/passing-token-from-the-oauth2-node-to-http-request-using-function-node/52403>\
**Category:** General\
**Tags:** security\
**Created:** [19 October 2021 09:23 UTC](https://discourse.nodered.org/t/passing-token-from-the-oauth2-node-to-http-request-using-function-node/52403 "2021-10-19T09:23:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SumeetBulani](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@SumeetBulani](https://discourse.nodered.org/u/SumeetBulani)\
**Post date:** [19 October 2021 09:23 UTC](https://discourse.nodered.org/t/passing-token-from-the-oauth2-node-to-http-request-using-function-node/52403/1 "2021-10-19T09:23:30Z")

</div>

Hello,  
I have been trying to pass the bearer token generated using oauth2 token into the http request node (use authentication is selected, type - bearer authentication, and the token is to be taken from the oauth2 node. There seems to be something wrong with the script in function node, I would really appreciate if someone could correct that.  
The idea was to create a tokenId variable and input it into the property (Token) of the next node. ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/e/5ef0fadde83ed9f3517b549bff82999a96f0a2b6.png)

---

<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:** [18 December 2021 09:23 UTC](https://discourse.nodered.org/t/passing-token-from-the-oauth2-node-to-http-request-using-function-node/52403/2 "2021-12-18T09:23:51Z")

</div>

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