Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication Error: not-authorized #2281

Closed
manojrao opened this issue Oct 10, 2017 · 15 comments
Closed

Authentication Error: not-authorized #2281

manojrao opened this issue Oct 10, 2017 · 15 comments

Comments

@manojrao
Copy link

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

@drixbarsali
Copy link

drixbarsali commented Oct 10, 2017

can you show the message that you´re getting?

@manojrao
Copy link
Author

Authentication Error: not-authorized

@manojrao
Copy link
Author

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
Copy link

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
Copy link

ik3umt commented Oct 11, 2017

same issue:

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

got code OK by SMS

yowsup-cli registration --register <sms_received_code> -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
Copy link

zer0exploits commented Oct 11, 2017

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

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

@ik3umt
Copy link

ik3umt commented Oct 12, 2017

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
Copy link

ik3umt commented Oct 12, 2017

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
Copy link

paly2 commented Oct 14, 2017

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
Copy link

r0alt commented Nov 9, 2017

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
Copy link

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

@r0alt
Copy link

r0alt commented Nov 11, 2017

@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
Copy link

paly2 commented Nov 11, 2017

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
Copy link

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
Copy link

Solved in #2319

Do not base64 encode your password on the configuration file

@tgalal tgalal closed this as completed May 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants