0

I was able to authenticate with cookies in ActionCable using cookies.signed[:user_id] but I can't figure out how to do it using keys. For example, sending an Authorization header when establishing a connection.

The only variable that is accessible in the ApplicationCable::Connection class is cookies. The other variables (params and headers) are not available.

Any ideas?

Artem Kalinchuk
  • 6,502
  • 7
  • 43
  • 57

1 Answers1

0

I was able to authenticate by sending authentication keys when subscribing to a channel. If keys are invalid, it calls connection.send(:reject_unauthorized_connection) in the channel.

Artem Kalinchuk
  • 6,502
  • 7
  • 43
  • 57