tgalal / yowsup

The WhatsApp lib
GNU General Public License v3.0
7.08k stars 2.23k forks source link

Authentication Error: not-authorized #2281

Closed manojrao closed 5 years ago

manojrao commented 7 years ago

hello, i have registered my number on yowsup successfully but message cannot be sent and received. please help me

drixbarsali commented 7 years ago

can you show the message that you´re getting?

manojrao commented 7 years ago

Authentication Error: not-authorized

manojrao commented 7 years ago

I am sharing the demo file which I am running after receiving password.

`from yowsup.demos import echoclient credentials = {'XXXXXXXXXX','PASSWORD'}

if not credentials: print("Error: You must specify a configuration method") sys.exit(1) try:

self.printInfoText()

stack = echoclient.YowsupEchoStack(credentials, True)
stack.start()

except KeyboardInterrupt: print("\nYowsdown") sys.exit(0)`

drixbarsali commented 7 years ago

Right... You´re missing something.. You need to define a configuration file.. the syntax is like this

yowsup-cli -s 55XXXXXXXXX 'testing send a message' -c config.conf

the -c is for configuration. If you don´t have a configuration file you can create it

sudo touch config.conf nano config.conf

Inside you will enter the cc, phone, id and password.

It shoul look like this:

cc= 55 phone= 55xxxxxxxxxxx id= 55xxxxxxxxxxxx password=xxxxxxxxxxxx

;)

ik3umt commented 7 years ago

same issue:

yowsup-cli registration --requestcode sms -E android --phone AAxxxxxxxxx --cc AA

got code OK by SMS

yowsup-cli registration --register -E android --phone AAxxxxxxxxx --cc AA

got answer OK like :

status: ok kind: free pw: lLFh9c1xrBmw5YA9lc1wXK+RtpI= price: $0.99 price_expiration: 1508329401 currency: USD cost: 0.99 expiration: 4444444444.0 login: AAxxxxxxxxx type: new

created config file :

cc=AA phone=AAxxxxxxxxx password=lLFh9c1xrBmw5YA9lc1wXK+RtpI=

issued cli command :

yowsup-cli demos -c mypath_to/config -E android -s [phone_no] "All OK?"

After few seconds prompt is back with no errors but no message delivered to recipient

Then issued command:

yowsup-cli demos -y -c mypath_to/config

with [offline]: prompt

/L command gives back :

general: Login Failed, reason: not-authorized Auth Error, reason not-authorized

Any hint please ?

zer0exploits commented 7 years ago

sudo yowsup-cli demos -l "AAxxxxxxxxx:lLFh9c1xrBmw5YA9lc1wXK+RtpI=" -s tonumberhere "'messsagehere"

Try like this. If "Auth Error, reason not-authorized" --> You banned...

ik3umt commented 7 years ago

Thank you for interesting,

Unfortunately, same error : Authentication Error: not-authorized

If I try option –E android no authentication error is reported, but no message delivered

Already tried user:password between double quotes or not

What to do to verify if I am banned and what to be un-banned ?

ik3umt commented 7 years ago

I have installed whatsapp on a tablet with the SIM card I'm using for yowsup test Whatsapp works correctly , so the problem resides on yowsup itself.

I have installed on a fresh Debian 9.1 "stretch" console with "apt-get install yowsup" after an apt update (it has installed all python packages too)

I hope not to encounter troubles in migrating often from real android to yowsup , whatsapp Faq say : If you are moving from one type of phone to another, such as from an iPhone to an Android, and preserving your number, you will keep your account info. This information is tied to the phone number. Simply download WhatsApp on the new phone and verify your number.

What else to be checked in yowsup ?

paly2 commented 7 years ago

I have almost the same problem, except that if I try to login with -E android, the error is Disconnected: Connection Closed:

upsilon@upsilonpc:~/programs/yowsup% yowsup-cli demos -c config.txt -y                                                             10/14/17 17:41:41
yowsup-cli  v2.0.15
yowsup      v2.5.2

[...]

[offline]:/L
general: Login Failed, reason: not-authorized
Auth Error, reason not-authorized

upsilon@upsilonpc:~/programs/yowsup% yowsup-cli demos -c config.txt -y -E android                                                  10/14/17 17:41:45
yowsup-cli  v2.0.15
yowsup      v2.5.2

[...]

[offline]:/L
general: Disconnected: Connection Closed
[offline]:
[offline]:
r0alt commented 7 years ago

password must finish with two "==" make sure it is 64base encoded, (you can do it on a online encoder/decoder base64) but also i get similar error.

File "/usr/local/lib/python3.5/dist-packages/yowsup2-2.5.2-py3.5.egg/yowsup/layers/auth/layer_authentication.py", line 81, in handleFailure raise AuthError(nodeEntity.getReason()) yowsup.layers.auth.autherror.AuthError: not-authorized

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/yowsup-cli", line 4, in import('pkg_resources').run_script('yowsup2==2.5.2', 'yowsup-cli') File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 748, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1517, in run_script exec(code, namespace, namespace) File "/usr/local/lib/python3.5/dist-packages/yowsup2-2.5.2-py3.5.egg/EGG-INFO/scripts/yowsup-cli", line 368, in if not parser.process(): File "/usr/local/lib/python3.5/dist-packages/yowsup2-2.5.2-py3.5.egg/EGG-INFO/scripts/yowsup-cli", line 272, in process self.startSendClient() File "/usr/local/lib/python3.5/dist-packages/yowsup2-2.5.2-py3.5.egg/EGG-INFO/scripts/yowsup-cli", line 324, in startSendClient stack.start() File "/usr/local/lib/python3.5/dist-packages/yowsup2-2.5.2-py3.5.egg/yowsup/demos/sendclient/stack.py", line 33, in start print("Authentication Error: %s" % e.message) AttributeError: 'AuthError' object has no attribute 'message'

10p30pl3 commented 7 years ago

@r0alt I have registered several sims, passwords usually finish with one '=', not two, correct?

r0alt commented 7 years ago

@10p30pl3 Yes the password you get finish with one "=" but after that you need to encode it using base64 (there are online webs that can do it) the encoded password must finish with 2 "==".

You can imput

Yowsup-cli resgistration --help-configuration

And check if the example password has the same number of characters than the encodedbase64 one

paly2 commented 7 years ago

After encoding the password in base64, the error is now the same with or without -E android.

Also, I noticed that the password changes each time I type yowsup-cli registration -c config.txt -m 208 -n 16 -r voice. Is it normal?

albertsola commented 6 years ago
yowsup-cli  v2.0.15
yowsup      v2.5.2

Follow the steps. If the password is base64 or any random string I got:

[offline]:/L
general: Login Failed, reason: not-authorized
Auth Error, reason not-authorized

If the password is the one given during the registration I got:

[offline]:/L
general: Disconnected: Connection Closed
[offline]:
[offline]:

This makes me think that the correct password is without encoding for the yowsup command line in the configuration file.

albertsola commented 6 years ago

Solved in https://github.com/tgalal/yowsup/issues/2319

Do not base64 encode your password on the configuration file