tgalal / yowsup

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

Auth Failed! #261

Closed regstraton closed 9 years ago

regstraton commented 10 years ago

Hi

I'm setting up yowsup-cli for the first time. I've successfully been through:

However I get an "Auth Failed!" when I try other operations.

Here I ran a --exists to demonstrate that I have registered correctly:

macreg:src reg$ ./yowsup-cli -c ./cfg -e
status: ok
kind: free
pw: qt8rw/Oj0gZWDIhjDereUvt6ops=
price: R7,99
price_expiration: 1402586711
currency: ZAR
cost: 7.99
login: 27712345678
type: existing
expiration: 1431029922

and then I updated the new password in my confg file:

macreg:src reg$ cat cfg
cc=27
phone=00712345678
id=458ab6d4-9319-47a6-c7d2-e230a12c7e66
password=qt8rw/Oj0gZWXIhjDereUvt6ops=

but when I run --listen, auth fails?

macreg:src reg$ ./yowsup-cli -c ./cfg -d -l
YowsupConnectionManager:    >>>>>>>>                         AUTH CALLED
BinTreeNodeReader:  Reader init
YowsupAuth: Connecting to c2.whatsapp.net
WAuth:  Yowsup WAUTH-1 INIT
WAuth:  Starting stream
WAuth:  Sending Features
BinTreeNodeWriter:  Outgoing
BinTreeNodeWriter:  
 <stream:features>
<receipt_acks>
</receipt_acks>
<w:profile:picture type="all">
</w:profile:picture>
<w:profile:picture type="group">
</w:profile:picture>
<notification type="participant">
</notification>
<status>
</status>
</stream:features>

WAuth:  Sending Auth
BinTreeNodeWriter:  Outgoing
BinTreeNodeWriter:  
 <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" user="00712345678" mechanism="WAUTH-1">
</auth>

WAuth:  Read stream start
WAuth:  Read features and challenge
BinTreeNodeReader:  Incoming
BinTreeNodeReader:  
<stream:features>
<receipt_acks>
</receipt_acks>
<w:profile:picture type="all">
</w:profile:picture>
</stream:features>

WAuth:  GOT FEATURES !!!!
BinTreeNodeReader:  Incoming
BinTreeNodeReader:  
<challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
????????Z??????T?</challenge>

WAuth:  GOT CHALLENGE !!!!
WAuth:  Sending Response
BinTreeNodeWriter:  Outgoing
BinTreeNodeWriter:  
 <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
?????A????d???wj[?????85
?A{],?9??Z"M????</response>

WAuth:  Read success
BinTreeNodeReader:  Incoming
BinTreeNodeReader:  
<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
<not-authorized>
</not-authorized>
</failure>

WAuth:  Login Status: failure
YowsupAuth: Authentication failed!!
Auth Failed!

I also tried the wauth2 branch without success:

macreg:src reg$ ./yowsup-cli -c ./cfg -d -l
YowsupConnectionManager:    >>>>>>>>                         AUTH CALLED
BinTreeNodeReader:  Reader init
YowsupAuth: Connecting to c2.whatsapp.net
WAuth2: Yowsup WAUTH-2 INIT
WAuth2: Starting stream
WAuth2: Sending Features
BinTreeNodeWriter:  Outgoing
BinTreeNodeWriter:  
 <stream:features>
</stream:features>

WAuth2: Sending Auth
BinTreeNodeWriter:  Outgoing
BinTreeNodeWriter:  
 <auth passive="false" user="00712345678" mechanism="WAUTH-2">
</auth>

WAuth2: Read stream start
WAuth2: Read features and challenge
BinTreeNodeReader:  Incoming
BinTreeNodeReader:  
<stream:features>
</stream:features>

WAuth2: GOT FEATURES !!!!
BinTreeNodeReader:  Incoming
BinTreeNodeReader:  
<challenge>
??)? ??cxD??d5?Tj_i?</challenge>

WAuth2: GOT CHALLENGE !!!!
WAuth2: Sending Response
22e56dca47c2e76309a587fad8664ad7b05ad5ef
e02a9f7239e4b2d247e164c437a3745987672114
026bb42829b60eff187b67b9f4058dc715f4817f
5aa01c93b48097f09867c90343c13760b1086dca
BinTreeNodeWriter:  Outgoing
BinTreeNodeWriter:  
 <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
Ӭ?n????nl?{
           ??????o??c
                     ?I??%+??*?(Z?E</response>

WAuth2: Read success
BinTreeNodeReader:  Incoming
BinTreeNodeReader:  
<failure>
<not-authorized>
</not-authorized>
</failure>

WAuth2: Login Status: failure
YowsupAuth: Authentication failed!!
Auth Failed!

Am I doing something wrong?

Many thanks, Reg

shirioko commented 10 years ago

Remove the leading zeroes in your phone number

regstraton commented 10 years ago

Thanks!!

This is why I don't usually read the docs: https://github.com/tgalal/yowsup/wiki/yowsup-cli#your-login-credentials ;)

Summary, I needed my full country code as the phone number, not padding zeros, as the docs in the above link suggested, e.g.:

macreg:src reg$ cat cfg
cc=27
phone=27712345678
id=458ab6d4-9319-47a6-c7d2-e230a12c7e66
password=qt8rw/Oj0gZWXIhjDereUvt6ops=
canercandan commented 10 years ago

Since I got the same issue the only way I found to solve it was to use the same way followed by file yowsup-cli:

You have to call this line before using the password to try to login:

password = base64.b64decode(bytes(PASSWORD.encode('utf-8')))

The problem appears also in the doc: https://github.com/tgalal/yowsup/wiki/Yowsup-Library-Documentation#invoking-methods

We cannot connect to WA withous encoding the password first.

elrodrix commented 10 years ago

@regstraton how you wauth2 tests? that's what you have to do to use wauth2?

kuldippatel commented 9 years ago

Hi Tarek,

Any idea, under what circumstances WhatsApp blocks a number? Sending 1 message to 30-50 numbers over the period of 2-3 days spread across 10-15 minutes resulted in blocking :(. Any set of rules? Would like to follow them strictly if known.

Looking forward to hear from you. Kuldip

sree0410 commented 8 years ago

Hi canercadon

while using yowsup-cli to login

do i have to obtain password by doing this password = base64.b64decode(bytes(PASSWORD.encode('utf-8')))

i have got the password as N6Yjce6Rh0gscc7MACY43MtStN0= when i apply above formula it would be 7\xa6#q\xee\x91\x87H,q\xce\xcc\x00&8\xdc\xcbR\xb4\xdd

i cant use the above string to login it throws an error

could you please help me , i am not able to activate my account , it says offline