# Send JWT authenticated requests to REST API

**URL:** https://discourse.nodered.org/t/send-jwt-authenticated-requests-to-rest-api/69604
**Category:** General
**Tags:** http-request
**Created:** [26 October 2022 07:56 UTC](https://discourse.nodered.org/t/send-jwt-authenticated-requests-to-rest-api/69604 "2022-10-26T07:56:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kitkat159](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kitkat159/32/66066_2.png) [@kitkat159](https://discourse.nodered.org/u/kitkat159)
#### Post date: [26 October 2022 07:56 UTC](https://discourse.nodered.org/t/send-jwt-authenticated-requests-to-rest-api/69604/1 "2022-10-26T07:56:39Z")

</div>

Hey everyone,  
I want to create nodes to access a custom REST API. This API uses JWT for authentication.  
I know, that in the http request node you can set a token, but I don't want to do that manually since the token expires. Ideally, I just set username and password and the flow requests a token which is used for accessing the API.  
I don't know where to start, have you got any ideas?

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [26 October 2022 11:35 UTC](https://discourse.nodered.org/t/send-jwt-authenticated-requests-to-rest-api/69604/2 "2022-10-26T11:35:41Z")

</div>

We cannot know either since the answer depends on how the API works. You will need to read the API documents to work out how to get an initial JWT and then how/when to refresh it. Then you will need to build that logic into a suitable flow.

---

<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: [25 December 2022 11:35 UTC](https://discourse.nodered.org/t/send-jwt-authenticated-requests-to-rest-api/69604/3 "2022-12-25T11:35:50Z")

</div>

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