grigio / obs-cmd

obs-cmd is a OBS cli for obs-websocket v5 the current obs-studio implementation. It is useful on Wayland Linux or to control OBS via terminal
MIT License
119 stars 19 forks source link

Authentication failed after update #17

Closed puyebu closed 11 months ago

puyebu commented 11 months ago

OBS Version: OBS 30.0.0-rc1-82-gba25bc65c-modified (linux) obs-cmd Version: 17.1

Failing to use the obs-cmd, getting auth errors. The password is added in obs-cmd.toml. It had worked before I have updated obs-cmd, I think.

obs-cmd output: Error: Handshake(ConnectionClosed(Some(CloseDetails { code: Library(4009), reason: "Authentication failed." })))

obs socket output with debug enabled:

info: [obs-websocket] [WebSocketServer::onOpen] New WebSocket client has connected from [::1]:33744
info: [obs-websocket] [debug] [WebSocketServer::onOpen] Sending Op 0 (Hello) message:
{
  "d": {
    "authentication": {
      "challenge": "[REDACTED]",
      "salt": "[REDACTED]"
    },
    "obsWebSocketVersion": "5.3.3",
    "rpcVersion": 1
  },
  "op": 0
}
info: [obs-websocket] [debug] [WebSocketServer::onMessage] Incoming message (decoded):
{
  "d": {
    "authentication": "[REDACTED]",
    "rpcVersion": 1
  },
  "op": 1
}
info: [obs-websocket] [WebSocketServer::onClose] WebSocket client `[::1]:33744` has disconnected with code `1006` and reason: End of File
puyebu commented 11 months ago

Figured it out, now it should work like this obs-cmd -w obsws://localhost:4455/password info I think it should be updated properly in help section or error be made clear-er.

grigio commented 11 months ago

I wrote this

obs-cmd --websocket obsws://localhost:4455/secret info # You can override the default `obsws` url

if you use secret as password it works without specify everytime obsws

puyebu commented 11 months ago

At least for me it was not clear that secret is the password until I've looked at sources because it was not mentioned in OBS. I thought that is just default request url without understanding that secret should be replaced with password. I think later I did encounter some message that clarifies it is password but in that case I believe it would be more clear to rename secret to password.