voryx / Thruway

PHP Client and Router Library for Autobahn and WAMP (Web Application Messaging Protocol) for Real-Time Application Messaging
MIT License
676 stars 118 forks source link

Wamp-CRA authentication ABORT after HELLO (unknown error) #276

Closed ozorOzora closed 6 years ago

ozorOzora commented 6 years ago

Hi there,

I'm trying to implement the Wampcra method following this example. I'm using wampy.js on the client side. Problem is, the server never proceeds to send the Challenge after receiving the Hello message from the client, and returns the following array though socket: [3,{},"thruway.error.unknown"] Here is my WebSocket server logs:

2017-12-08T11:55:05.6905630 debug      [Thruway\Transport\RatchetTransportProvider 19924] RatchetTransportProvider::onOpen
2017-12-08T11:55:06.4756340 debug      [Thruway\Transport\RatchetTransportProvider 19924] onMessage: ([1,"realm1",{"agent":"Wampy.js v6.0.0","roles":{"publisher":{"features":{"subscriber_blackwhite_listing":true
,"publisher_exclusion":true,"publisher_identification":true}},"subscriber":{},"caller":{"features":{"caller_identification":true,"progressive_call_results":true,"call_canceling":true,"call_timeout":true}},"calle
e":{"features":{"caller_identification":true}}},"authmethods":["wampcra"],"authid":"joe"}])
2017-12-08T11:55:06.4762560 info       [Thruway\RealmManager 19924] Got prehello...
2017-12-08T11:55:06.4766910 debug      [Thruway\Authentication\WampCraAuthProvider 19924] Client onMessage: [Thruway\Message\InvocationMessage]
2017-12-08T11:55:06.4770850 debug      [Thruway\Authentication\AuthenticationManager 19924] Client onMessage: thruway.auth.wampcra.onhello.error
2017-12-08T11:55:06.4772260 error      [Thruway\Authentication\AuthenticationManager 19924] onhello rejected the promise
2017-12-08T11:55:06.4773310 debug      [Thruway\Realm 19924] Leaving realm realm1
2017-12-08T11:55:06.4775820 info       [Thruway\Transport\RatchetTransportProvider 19924] Ratchet has closed

Do you have any idea about what could be going on?

ozorOzora commented 6 years ago

it turns out I'm using php7, and class Thruway\Authentication\WampCraAuthProvider is using deprecated function create_random_iv(). Updating to version 0.5 of voryx/Thruway solved this.