LogOut Redirect

206 views
Skip to first unread message

Nitin Gautam

unread,
Mar 16, 2017, 1:00:06 AM3/16/17
to Node-RED
I am using a microservice for authentication to Node Red below is the flow.

User comes from login microservice site generate token and post to NodeRed which allows it to login.

Once user logOut I want to redirect user back to login page of Microservice which js code handling this in node Red? 

Nick O'Leary

unread,
Mar 17, 2017, 7:09:27 AM3/17/17
to Node-RED Mailing List
Hi,

we don't provide any hooks for this - but it is something we should consider for precisely this use case.

A logout happens by:

1. the editor sends an http post sent to /auth/revoke to revoke the auth token (http://nodered.org/docs/api/admin/oauth#revoking-the-token)
2. when that returns, it reloads the page to ensure everything is reset to a clean state - https://github.com/node-red/node-red/blob/5c2e7ce407d1273c3f3d8c7eedb29a5f4163e1d3/editor/js/user.js#L133

We'd need some mechanism to provide an alternative url to redirect to, rather than just do a reload.

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/2602406c-f77c-4d15-a586-18b18eacd0aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nitin Gautam

unread,
Mar 18, 2017, 10:01:23 AM3/18/17
to Node-RED
Thanks Nick. I will try on this. and definitely this use case will be helpful for others who want microservice based auth :)


On Friday, March 17, 2017 at 6:09:27 AM UTC-5, Nick O'Leary wrote:
Hi,

we don't provide any hooks for this - but it is something we should consider for precisely this use case.

A logout happens by:

1. the editor sends an http post sent to /auth/revoke to revoke the auth token (http://nodered.org/docs/api/admin/oauth#revoking-the-token)
2. when that returns, it reloads the page to ensure everything is reset to a clean state - https://github.com/node-red/node-red/blob/5c2e7ce407d1273c3f3d8c7eedb29a5f4163e1d3/editor/js/user.js#L133

We'd need some mechanism to provide an alternative url to redirect to, rather than just do a reload.

Nick
On 16 March 2017 at 05:00, Nitin Gautam <gautam...@gmail.com> wrote:
I am using a microservice for authentication to Node Red below is the flow.

User comes from login microservice site generate token and post to NodeRed which allows it to login.

Once user logOut I want to redirect user back to login page of Microservice which js code handling this in node Red? 

--
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+u...@googlegroups.com.

Nitin Gautam

unread,
Mar 18, 2017, 10:06:01 AM3/18/17
to Node-RED
We can add URL in settings.js file for configurability
Reply all
Reply to author
Forward
0 new messages