I have tested signature generation to both endpoints with identical data to sign. I’ve hided my API Key from server replys but be sure it is the same. This is log data from two parallel threads. I’ve stored timestamp from first and use it in second thread. As you can see, signatues it is the same. After "W: " the data that goes to web socket. "R: " - received from socket.
12:06:58.8927 Connecting to wss://ws-api.binance.com/ws-api/v3
12:07:00.0261 W: {"id":"128","method":"session.logon","params":{"apiKey":"my_key","signature":"1zpzJs3sRvGOwx7JX1hfy0FUjyMiNYte0KEy/bQabjKkR+QciDN4qtESes5/zrugzEE3T/lHJ4Ws6KBva3BvCA=","timestamp":1716466020026}}
12:07:00.3000 R: {"id":"128","status":200,"result":{"apiKey":"my_key","authorizedSince":1716466020026,"connectedSince":1716466019886,"returnRateLimits":true,"serverTime":1716466020162}}
12:06:58.8937 Connecting to wss://ws-fapi.binance.com/ws-fapi/v1
12:07:00.0317 W: {"id":"128","method":"session.logon","params":{"apiKey":"my_key","signature":"1zpzJs3sRvGOwx7JX1hfy0FUjyMiNYte0KEy/bQabjKkR+QciDN4qtESes5/zrugzEE3T/lHJ4Ws6KBva3BvCA=","timestamp":1716466020026}}
12:07:00.3085 R: {"id":"128","status":400,"error":{"code":-1022,"msg":"Signature for this request is not valid."}}
Non-signed requests are working:
11:55:23.5421 Connecting to wss://ws-fapi.binance.com/ws-fapi/v1
11:55:24.6768 W: {"id":"32768","method":"userDataStream.start","params":{"apiKey":""}}
11:55:24.9538 R: {"id":"32768","status":200,"result":{"listenKey":"my_listen_key"} ... }
But signed equests are not:
11:55:24.9543 W: {"id":"128","method":"session.logon","params":{"apiKey":"","signature":"tUUDtBv1ZP7W3RgQrZZQ7wrCAHuqLw9XyrEw8iKe0SbxhgXXVLyzO9tOhyzzLMycVX4WN/AxGunKxBCe4sc6Bg=","timestamp":1716465324954}}
11:55:25.2295 R: {"id":"128","status":400,"error":{"code":-1022,"msg":"Signature for this request is not valid."} ... }
Tryed other key pair and double checked that Futures is enabled in it, IP is correct, etc.