ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROSBridge - Unknown Operation: Auth?

asked 2013-11-25 00:54:53 -0600

trianta2 gravatar image

updated 2013-11-25 02:23:49 -0600

Hi Everyone,

I have ROSBridge Server and a client I wrote communicating just fine. Now I want to enable authentication.

I set "authenticate" to true in the ROSBridge launch file. I also started rosauth and set the "secret_file_location" param to point to a text file containing a 16 character key (which I use to encrypt my MAC using SHA-256).

When I launch the ROSBridge server, it disconnects any clients which communicate with it unless they have have "auth" in their "op" field. So if I try to "subscribe" or "publish", it will just disconnect the client. Now, the peculiar thing is that ROSBridge will then print to screen: "Unknown operation: auth. Allowed operations: ['call_service', 'publish', 'subscribe', 'unsubscribe', 'unadvertise', 'advertise']"

So it definitely understands that "auth" is an operation... because it does not immediately disconnect my client. However it tells me that "auth" is unknown. What's the deal?

EDIT: Here is my launch file:

<launch>
  <arg name="port" default="9090" />
  <arg name="ssl" default="false" />
  <arg name="certfile" />
  <arg name="keyfile" />
  <arg name="authenticate" default="true" />

  <param name="/rosbridge/port" value="$(arg port)"/>

  <group ns="ros_mac_authentication">
  <param name="secret_file_location" value="/home/developer/SecretFile.secret" />
  <node pkg="rosauth" type="ros_mac_authentication" name="ros_mac_authentication" />
  </group>

  <group if="$(arg ssl)">
    <node name="rosbridge_websocket" pkg="rosbridge_server" type="rosbridge_websocket" output="screen">
      <param name="certfile" value="$(arg certfile)" />
      <param name="keyfile" value="$(arg keyfile)" />
      <param name="authenticate" value="$(arg authenticate)" />
    </node>
  </group>
  <group unless="$(arg ssl)">
    <node name="rosbridge_websocket" pkg="rosbridge_server" type="rosbridge_websocket" output="screen">
      <param name="authenticate" value="$(arg authenticate)" />
    </node>
  </group>

  <node name="rosapi" pkg="rosapi" type="rosapi" />
</launch>
edit retag flag offensive close merge delete

Comments

1

Are you using the most recent version of rosbridge from source or debians? What parameters have you set in the launch file?

rtoris288 gravatar image rtoris288  ( 2013-11-25 02:07:41 -0600 )edit

I am using the version of rosbridge that I got from "apt-get install ros-hydro-rosbridge-suite". The package.xml file I have says version 0.5.1. As for the launch file, I'll update my post to include its contents.

trianta2 gravatar image trianta2  ( 2013-11-25 02:21:26 -0600 )edit
1

Is the message about awaiting authentication printing when the socket connects? I.e., https://github.com/RobotWebTools/rosbridge_suite/blob/hydro-devel/rosbridge_server/scripts/rosbridge_websocket#L69-L70

rtoris288 gravatar image rtoris288  ( 2013-11-25 06:35:23 -0600 )edit

Yes it is. I downloaded the source and I've been poking around as well. It appears that L81 "resp = auth_srv(...)" throws an exception, but I still cannot figure out why.

trianta2 gravatar image trianta2  ( 2013-11-25 06:39:54 -0600 )edit
1

That was going to be my next suggestion. Make sure the message has all the correct fields or it might throw an excepting trying to access something that doesn't exist. https://github.com/RobotWebTools/rosbridge_suite/blob/hydro-devel/rosbridge_server/scripts/rosbridge_websocket#L81-L83

rtoris288 gravatar image rtoris288  ( 2013-11-25 06:42:22 -0600 )edit

I'm currently printing all of the fields to console. An exception was thrown upon printing the time field, yet I'm not sure why. Still investigating...

trianta2 gravatar image trianta2  ( 2013-11-25 06:50:48 -0600 )edit
1

What is your client sending in the time fields? It should be a number (make sure it's not being sent as a string or anything), in seconds.

rtoris288 gravatar image rtoris288  ( 2013-11-25 06:54:05 -0600 )edit

My client (for test purposes) is sending t : 1 and end : 2. ROS is printing that the received 't' is 1000000000 and the received 'end' is 2000000000. So the server appears to be appending nine 0's to the end of whatever I send. I suppose that's what rospy.Time() is doing, but why?

trianta2 gravatar image trianta2  ( 2013-11-25 06:59:58 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-11-26 02:14:48 -0600

trianta2 gravatar image

Okay, so after a lot of poking around I found my problem(s):

  1. I was sending a string for the time values when I should have been sending integers. This was throwing the exception of "Unknown Operation: Auth" which was throwing me off.

  2. For time values, I was sending the seconds relative to when my program started. This was wrong. I should have been sending seconds since epoch (http://en.wikipedia.org/wiki/Unix_time). Of course.

I hope this is useful for people with this problem in the future.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2013-11-25 00:54:53 -0600

Seen: 1,516 times

Last updated: Nov 26 '13