# Custom Authentication And Replacing Application Tokens

**URL:** https://discourse.nodered.org/t/custom-authentication-and-replacing-application-tokens/37508
**Category:** General
**Created:** [14 December 2020 23:32 UTC](https://discourse.nodered.org/t/custom-authentication-and-replacing-application-tokens/37508 "2020-12-14T23:32:53Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![shaounak](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shaounak/32/33677_2.png) [@shaounak](https://discourse.nodered.org/u/shaounak)
#### Post date: [15 December 2020 16:40 UTC](https://discourse.nodered.org/t/custom-authentication-and-replacing-application-tokens/37508/6 "2020-12-15T16:40:49Z")

</div>

Yes, I get this. I had success in implementing the same too. Now I want to use the same token for my front end to use in my custom nodes to authenticate to another API which will return the JSON payload for the drop-down I had built in the custom node. If I pass the token I can pretty much access the same using

```auto
localStorage.getItem("auth-tokens"))["access_token"]

```

How can I do the same when I pass the User Name and Password? I mean when I pass the User Name and Password and authenticate to the API which returns me the token, how can reuse the same token instead of a node-red created token. Here is the flow diagram to simplify the ask -

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/7/07ca44eedc619cad82aedc3534b7912bba9d6305.png)

---

_[View the full topic](https://discourse.nodered.org/t/custom-authentication-and-replacing-application-tokens/37508)._
