Published 5 months ago by danaia
I have two computers each with their own touchscreen for authentication. When a user authenticates on one computer it also authenticates on the other computer and updates the screens asynchronously to the authenticated view. What is the best way to do this? The user story: As a user I need to login into a system using a single sign on on one computer but have all computers on the network become 'awake' when I log in.
I am using jQuery, Laravel 5.5 and ROS
How would the other device know that it is associated with a particular user?
Assuming there is something that tackles this issue, when a user logs in, create a nice long token and store it on the users record. Broadcast this token to other devices that are for this user using web sockets or pusher.
When a device receives the token it sends it back to the server as a login token. If the token matches with thr one in the database, log the user in using the standard Auth guard
note that if the second device is not used for a while the session will expire
This does seem a strange use case though and I would seriously question why someone would want this
I am not pretty sure what you mean with network become awake? The technologie you are looking for is web socket: https://www.html5rocks.com/de/tutorials/websockets/basics/
Laravel has an implrmentation in order to broadcast well at least messages: https://laravel.com/docs/5.5/broadcasting
Hope this give you a hint.
I am creating touch interfaces to control industrial robots. A single robot is managed by 3 touchscreens. There are two PI 7" touchscreen interfaces on the side of the robot, and a central 10" touchscreen on an ATOM (the server) based computer running ROS (http://www.ros.org/). I am using ROSbridge (http://wiki.ros.org/rosbridge_suite) to communicate with ROS topics and serivices via websockets perfectly. I have chosen Laravel and Jquery as the primary tech under Chrome (kiosk mode) and everything is working great. Very responsive! The robots are very happy :) As it is now, the user needs to authenticate (We call it binding) with the robot on the side panels. When the user does this, we want all the touchscreens/computers to become active (we call it 'awake') (2 PI computers and 1 ATOM computer). We do not want the the user to need to bind every time they want to interact with one of the displays. What @Snapey mentioned is basically where I was heading - may try to use ROSbridge through websockets to send the token through a ROS topic. But not sure if the token will be valid when it leaves the ATOM computer. This is not a web application by any means. It is a highly closed system and does not speak to the web in any way. I just rather build interfaces using web tech VS QT. Who wouldn't ;)
Yep, I solved it using ROS. Rather use ROS vs Laravel Echo since ROS does async multi node communicate natively where with Echo, we would need another 3rd party library (Redis or Pusher). Hate using libraries when it may not be needed. (BTW we chose Laravel and jQuery because 5.5 has a 5 year LTS and jQuery just works and easy to pick up as we scale. Vue, Angular and others are just moving too fast. Been on projects where so much time is lost with versioning hell).
I recommend playing with ROS and ROSlibjs. The ROS architecture is incredible.
Back to the solution: How we have it set up is nice - we just make a service call with the userID and a ROS topic gets updated with the userID. All the other computers listen in on the ROS topic, grabs the userID and logs them in. When the user moves away from the robot within a certain distance, they are logged out. Simple, happy robot.
@martinbean I ref Redis or Pusher. Would they not be libraries? Laravel is a framework, I know. I am not too sharp. I try, but all these words about technology just confuse me. I will never find work in the tech space. Thanks for letting me better understand my limitations.