# How to open NR - from my web app based based on user authentication

**URL:** https://discourse.nodered.org/t/how-to-open-nr-from-my-web-app-based-based-on-user-authentication/96962
**Category:** General
**Created:** [8 May 2025 06:52 UTC](https://discourse.nodered.org/t/how-to-open-nr-from-my-web-app-based-based-on-user-authentication/96962 "2025-05-08T06:52:58Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![SandeepA](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sandeepa/32/63225_2.png) [@SandeepA](https://discourse.nodered.org/u/SandeepA)
#### Post date: [8 May 2025 06:52 UTC](https://discourse.nodered.org/t/how-to-open-nr-from-my-web-app-based-based-on-user-authentication/96962/1 "2025-05-08T06:52:59Z")

</div>

Hi

I need to integrate NR into a my web based application .  
Today all i do is give the NR link in my menu and user clicks and NR opens.  
I would like to have user /password authentication done seamlessly when user accesses it via. my web. Else gets login/password NR dialog.

So the flow would be

1. User connects to my app. Logs in with user / password. A menu gets displayed.
2. When he clicks NR menu option - we open the NR URL - authentication happens and editor gets displayed
3. But if user takes the NR URL externally to the browser - he should be prompted for login / password.

#2 is which i am bit lost on how to achieve it.

Any suggestions pointers.

---

<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: [8 May 2025 12:02 UTC](https://discourse.nodered.org/t/how-to-open-nr-from-my-web-app-based-based-on-user-authentication/96962/2 "2025-05-08T12:02:42Z")

</div>

This would be most easily and securely done by placing both apps behind a reverse proxy such as NGINX, Caddy or HAproxy and getting the proxy to deal with the authentication.

You can change the settings in Node-RED to trust your proxy so that all appropriate headers are sent through. If you need to do a further auth check in Node-RED, you can then do so - though that shouldn't be necessary, simply change Node-RED's settings to only be accessible from localhost (if you run the proxy on the same device).

---

<div class="post-metadata">

### Author: ![AllanOricil](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allanoricil/32/106911_2.png) [@AllanOricil](https://discourse.nodered.org/u/AllanOricil)
#### Post date: [9 May 2025 09:27 UTC](https://discourse.nodered.org/t/how-to-open-nr-from-my-web-app-based-based-on-user-authentication/96962/3 "2025-05-09T09:27:09Z")

</div>

Another option is to make your app's server redirect the user to the node-red instance while also sending some headers for authentication.

app -\> user click on the link -\> app server -\> add auth headers, including the redirect header -\> node-red

---

<div class="post-metadata">

### Author: ![SandeepA](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sandeepa/32/63225_2.png) [@SandeepA](https://discourse.nodered.org/u/SandeepA)
#### Post date: [16 May 2025 17:02 UTC](https://discourse.nodered.org/t/how-to-open-nr-from-my-web-app-based-based-on-user-authentication/96962/4 "2025-05-16T17:02:54Z")

</div>

Thanks @AllanOricil .

I could not find documentation how to open NR editor by sending headers for authentication.  
The documentation is a bit confusing.  
I was referring to -

> **[Securing Node-RED : Node-RED](https://nodered.org/docs/user-guide/runtime/securing-node-red)**

I cannot define user/pass in settings - that would be a security breach.  
That means i need to "Custom authentication tokens" mechanism ?

But then it says to send custom token - _" To access the editor using a custom token without the login prompt, add `?access_token=<ACCESS_TOKEN>` to the URL. The editor will store that token locally and use it for all future requests."_

Wouldn't that defeat the purpose of having a token ?

I am not getting clarity on -

1. Where do i define the user / password
2. How to get such token on this user/password
3. And how to open editor with such token

If there is an example i will appreciate it very much.

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [16 May 2025 17:15 UTC](https://discourse.nodered.org/t/how-to-open-nr-from-my-web-app-based-based-on-user-authentication/96962/5 "2025-05-16T17:15:24Z")

</div>

> [@SandeepA](#):
>
> I need to integrate NR into a my web based application .

Or.. (Just putting it out there)

Literally integrate Node RED in your application, as if it was apart of your code base (if its Node JS Mind you)

> **[Embedding into an existing app : Node-RED](https://nodered.org/docs/user-guide/runtime/embedding)**

You can then control (right down to the runtime itself) embedded authentication routines

(This is how I achieve Node RED SFE)  
I wont link due to not wanting to advertise on someone's post

I think Node RED's ability to become fully integrated into others apps, is overlooked - its a pretty potent feature

---

<div class="post-metadata">

### Author: ![SandeepA](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sandeepa/32/63225_2.png) [@SandeepA](https://discourse.nodered.org/u/SandeepA)
#### Post date: [16 May 2025 20:21 UTC](https://discourse.nodered.org/t/how-to-open-nr-from-my-web-app-based-based-on-user-authentication/96962/6 "2025-05-16T20:21:41Z")

</div>

Unfortunately that would be a big change for me.  
I was hoping to pass a bearer/basic token and have the authentication done .  
Continuining to check.

---

<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: [16 May 2025 20:30 UTC](https://discourse.nodered.org/t/how-to-open-nr-from-my-web-app-based-based-on-user-authentication/96962/7 "2025-05-16T20:30:03Z")

</div>

The env variable work-around is the easiest.

---

<div class="post-metadata">

### Author: ![SandeepA](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sandeepa/32/63225_2.png) [@SandeepA](https://discourse.nodered.org/u/SandeepA)
#### Post date: [16 May 2025 20:32 UTC](https://discourse.nodered.org/t/how-to-open-nr-from-my-web-app-based-based-on-user-authentication/96962/8 "2025-05-16T20:32:41Z")

</div>

Can you elaborate ? I am not clear on the solution you are hinting.

---

<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: [14 August 2025 20:33 UTC](https://discourse.nodered.org/t/how-to-open-nr-from-my-web-app-based-based-on-user-authentication/96962/9 "2025-08-14T20:33:21Z")

</div>

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