throneless-tech / libsignal-service-javascript

A javascript library for basic interaction with the Signal messaging service, adapted from Signal-Desktop.
GNU General Public License v3.0
57 stars 21 forks source link

Forbidden Error Code During Device Registration #10

Closed ozlop closed 3 years ago

ozlop commented 4 years ago

I'm receiving a 403 Forbidden error code when attempting to register a new device. Has the openwhisper API changed since the creation of this library?

Original stack: Error at _outerAjax (node_modules\@throneless\libsignal-service\src\WebAPI.js:385:19) at _ajax (node_modules\@throneless\libsignal-service\src\WebAPI.js:488:14) at Object.confirmCode (node_modules\@throneless\libsignal-service\src\WebAPI.js:646:30) at AccountManager.createAccount (node_modules\@throneless\libsignal-service\src\AccountManager.js:417:40) name: 'HTTPError', code: 403, response: '{"code":403,"message":"HTTP 403 Forbidden"}' }

jheretic commented 4 years ago

Hi @ozlop , thanks for the report! I'll take a look at this in the next day or so. I'm not aware of any breaking upstream API changes, but the library's overdue for an update to keep in sync w/ the latest Signal Desktop anyway, so at the very least I'll be tackling that soon.

gausma commented 3 years ago

Any idea about this? I've tried different numbers from different countries and keep getting error 403 Requesting the registration code via sms is no problem.

C:\Temp\libsignal-service-javascript>node .\examples\client.js register +4915902934xxx pwd12345xxx 617-292 { HTTPError: promiseAjax: error response; code: 403 at HTTPError (C:\Temp\libsignal-service-javascript\src\WebAPI.js:389:13) at resultPromise.then.result (C:\Temp\libsignal-service-javascript\src\WebAPI.js:345:13) at process._tickCallback (internal/process/next_tick.js:68:7) Original stack: Error at _outerAjax (C:\Temp\libsignal-service-javascript\src\WebAPI.js:383:19) at _ajax (C:\Temp\libsignal-service-javascript\src\WebAPI.js:502:14) at Object.confirmCode (C:\Temp\libsignal-service-javascript\src\WebAPI.js:674:30) at AccountManager.createAccount (C:\Temp\libsignal-service-javascript\src\AccountManager.js:410:40) name: 'HTTPError', code: 403, response: { code: 403, message: 'HTTP 403 Forbidden' } }

Tried with Node versions: 14.15.0/x64, 10.23.0/x64, 8.11.1/x64

jheretic commented 3 years ago

It's most likely that this is just due to rate limiting; the Signal service's IP-based rate limiting is pretty aggressive. I'd wait a few hours and try again. Lmk if you still get the same issue, and I'll help troubleshoot more.

gausma commented 3 years ago

I think I got it. Signal is sending the registration SMS: "SIGNAL: Your code is: 855-911" For a successful registration, the minus in the registration code must be omitted. I did it that way: node .\examples\client.js register +4915902937xxx pwd12345xxx 855911 Can you confirm it?

gausma commented 3 years ago

I tried to use the productive environment now. I'm receiving the following error:

C:\Temp\libsignal-service-javascript>SET NODE_ENV=production C:\Temp\libsignal-service-javascript>set STORE=./thrd_node C:\Temp\libsignal-service-javascript>node .\examples\client.js register +4915902937xxx pwd12345xxx 746518 { HTTPError: promiseAjax: error response; code: 423 at HTTPError (C:\Temp\libsignal-service-javascript\src\WebAPI.js:389:13) at resultPromise.then.result (C:\Temp\libsignal-service-javascript\src\WebAPI.js:345:13) at process._tickCallback (internal/process/next_tick.js:68:7) Original stack: Error at _outerAjax (C:\Temp\libsignal-service-javascript\src\WebAPI.js:383:19) at _ajax (C:\Temp\libsignal-service-javascript\src\WebAPI.js:502:14) at Object.confirmCode (C:\Temp\libsignal-service-javascript\src\WebAPI.js:674:30) at AccountManager.createAccount (C:\Temp\libsignal-service-javascript\src\AccountManager.js:410:40) name: 'HTTPError', code: 423, response: { timeRemaining: 443646368, backupCredentials: { username: '95d91d6a-7d1d-41f0-a3e6-a3b1afbe0c73', password: '95d91d6a-7d1d-41f0-a3e6-a3b1afbe0c73:1608669953:6277f97cd5b12c6655f9' } } }

Did you recognize something like this?

michaelkebe commented 3 years ago

I can confirm to use the verification code without a minus. I got it working:

node client.js requestVoice +55555555555 secretpassword
node client.js register +55555555555 secretpassword verificationcode
node client.js send +5555555666 Test

I am using Linux, not Windows.