How to inject a user context / access token to an embedded Node-Red?

476 views
Skip to first unread message

mw75

unread,
Mar 27, 2017, 11:24:46 AM3/27/17
to Node-RED
Hi all!

How do i get the editor to use an authentication header for api-calls without requiring a user login while embedding?

I have Node-Red up and running. I can protect the red and api path by requiring a Token. But how do i tell the editor what token to use? 

I could use a cookie middleware in front, but that feels wrong.

Any hints or suggestions?

Thangs! 

Regards,
Mario

PS: To redirect an user on Logout from the UserMenu i would clear his session on auth/revoke and redirect on access /red without a session? Is there an other solution/hook? 


Nick O'Leary

unread,
Mar 27, 2017, 11:38:14 AM3/27/17
to Node-RED Mailing List
Hi,

assuming you have a valid access token, you can passing it as url parameter when accessing the editor:


the editor will then use that token for subsequent requests.

Currently a logout refreshes the page with the token cleared; we don't have a mechanism to redirect to another page, but we do have a task on the backlog to provide such a capability - https://trello.com/c/dYQiFpX4

Nick


--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/329f2a25-a2f6-4dbb-92a0-1f8041d86e45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages