# Custom Authentication using Cookie

**URL:** https://discourse.nodered.org/t/custom-authentication-using-cookie/11598
**Category:** General
**Created:** [27 May 2019 12:34 UTC](https://discourse.nodered.org/t/custom-authentication-using-cookie/11598 "2019-05-27T12:34:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![RaiBnod](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@RaiBnod](https://discourse.nodered.org/u/RaiBnod)
#### Post date: [27 May 2019 12:34 UTC](https://discourse.nodered.org/t/custom-authentication-using-cookie/11598/1 "2019-05-27T12:34:10Z")

</div>

We have a documentation on Custom User Authentication:  
[https://nodered.org/docs/security#custom-user-authentication](https://nodered.org/docs/security#custom-user-authentication)

But I need little bit more. I have a `React` site with:

- A custom `username` and a `password` field validator (`HTML` form).
- Integrated `IFrame` of `NodeRED`.

After react validation success, I get JWT token. So when I login to the `React` site, I don't need this `NodeRED` dialogue form for re-entering the `username` and `password`. I want to use that JWT token for the validation. How can I achieve this functionality?

---

<div class="post-metadata">

### Author: ![baha00](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/baha00/32/6652_2.png) [@baha00](https://discourse.nodered.org/u/baha00)
#### Post date: [29 May 2019 11:05 UTC](https://discourse.nodered.org/t/custom-authentication-using-cookie/11598/2 "2019-05-29T11:05:35Z")

</div>

Not sure how, but there is jwt authorization node node-red-contrib-auth it might help you, and  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/cb34129ba6e621f855c98c4c8902d93a243fa529.png)

---

<div class="post-metadata">

### Author: ![RaiBnod](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@RaiBnod](https://discourse.nodered.org/u/RaiBnod)
#### Post date: [29 May 2019 11:30 UTC](https://discourse.nodered.org/t/custom-authentication-using-cookie/11598/3 "2019-05-29T11:30:18Z")

</div>

That is just a `Node` of `NodeRED`. But I want to replace that authentication dialogue box with my `JWT` token of `WebApp`.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/169351073bba9bfabfffaed4414b005c9994c22a.png)

Don't wanna see this, when I have `JWT` token in my `WebApp`.

---

<div class="post-metadata">

### Author: ![baha00](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/baha00/32/6652_2.png) [@baha00](https://discourse.nodered.org/u/baha00)
#### Post date: [30 May 2019 21:15 UTC](https://discourse.nodered.org/t/custom-authentication-using-cookie/11598/4 "2019-05-30T21:15:31Z")

</div>

@RaiBnod but this is admin interface login, dont you want /ui authorized with JWT ?

---

<div class="post-metadata">

### Author: ![RaiBnod](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@RaiBnod](https://discourse.nodered.org/u/RaiBnod)
#### Post date: [31 May 2019 08:42 UTC](https://discourse.nodered.org/t/custom-authentication-using-cookie/11598/5 "2019-05-31T08:42:28Z")

</div>

> [@baha00](#):
>
> dont you want /ui authorized with JWT

Just want to do admin interface login via my own JWT token (I have JWT token in my WebApp not in NodeRED).

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [31 May 2019 08:57 UTC](https://discourse.nodered.org/t/custom-authentication-using-cookie/11598/6 "2019-05-31T08:57:12Z")

</div>

Hi @RaiBnod

the Node-RED auth system doesn't allow you to use your own token.

You would need to do something along the lines of:

1. once a user has logged into your application, obtain a valid access token for them - [https://nodered.org/docs/api/admin/oauth](https://nodered.org/docs/api/admin/oauth)

2. when you load the NR editor, pass in that access token in the url as a query param - `?access_token=YOUR_TOKEN` - that will bypass the login screen.

---

<div class="post-metadata">

### Author: ![RaiBnod](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@RaiBnod](https://discourse.nodered.org/u/RaiBnod)
#### Post date: [4 June 2019 18:05 UTC](https://discourse.nodered.org/t/custom-authentication-using-cookie/11598/7 "2019-06-04T18:05:29Z")

</div>

@knolleary Hey Nick, thank for your solution, it resolves my problem.

Much appreciated your reply. 🙂 Cheers!!!
