# Access REST API to retrieve a JSON Web Token (JWT)

**URL:** <https://discourse.nodered.org/t/access-rest-api-to-retrieve-a-json-web-token-jwt/3840>\
**Category:** General\
**Created:** [10 October 2018 02:23 UTC](https://discourse.nodered.org/t/access-rest-api-to-retrieve-a-json-web-token-jwt/3840 "2018-10-10T02:23:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpummill](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@jpummill](https://discourse.nodered.org/u/jpummill)\
**Post date:** [10 October 2018 02:23 UTC](https://discourse.nodered.org/t/access-rest-api-to-retrieve-a-json-web-token-jwt/3840/1 "2018-10-10T02:23:31Z")

</div>

Hi Everyone, I am new to Node-RED and not sure how to proceed.

I need to access a REST API to retrieve a JSON Web Token (JWT)

I can do this with the following curl command:

curl -X POST [https://servername:1925/myapp/login](https://servername:1925/myapp/login) -H 'content-type: application/vnd.myapp+json;version=1.0' -d '{ "userName":"myusername", "password":"mypassword"}'

I'm guessing I could use an http-request node but not sure how I would configure it or how I would store the JWT for use on the next request to my applications REST API.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [10 October 2018 06:09 UTC](https://discourse.nodered.org/t/access-rest-api-to-retrieve-a-json-web-token-jwt/3840/2 "2018-10-10T06:09:31Z")

</div>

The http request headers link in the cookbook should help you start to do this  
[https://cookbook.nodered.org](https://cookbook.nodered.org)
