tgalal / yowsup

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

Authentication failure using the API #31

Closed blacklight closed 9 years ago

blacklight commented 11 years ago

I've been using Yowsup API for many days flawlessly. Anyway, since 2 days my code suddenly refuses to authenticate to Whatsapp, and on any authentication the auth_fail handler is always triggered. Was something changed in the authentication mechanism? Shall I provide further details?

tgalal commented 11 years ago

Did it happen that you accidentally registered using same number on phone?

blacklight commented 11 years ago

No, it also seems to happen when my mobile is switched off. The error message contained in the auth_fail handler is just "invalid".

blacklight commented 11 years ago

Here is the full sequence (debug=True) that brings to the error above:

YowsupConnectionManager:    >>>>>>>>                         AUTH CALLED
BinTreeNodeReader:  Reader init
Connecting to c.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="*********" 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>
<notification type="participant">
</notification>
</stream:features>

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

WAuth:  GOT CHALLENGE !!!!
WAuth:  Sending Response
BinTreeNodeWriter:  Outgoing
BinTreeNodeWriter:  
 <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
*********</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
AUTH FAIL
tgalal commented 11 years ago

it means your password is incorrect. Have you updated to latest yowsup version which has a new config file format?

blacklight commented 11 years ago

Is there any documentation on how the password should be generated now? I'm using Utilities.getPassword(imei) (on Android) in order to get the password, and this had been working until a pair of weeks ago: has this mechanism changed now? If so, how?

Thanks, Fabio

blacklight commented 11 years ago

Any news...? Thanks

tgalal commented 11 years ago

You cannot generate same password anymore, specially if you have recently updated your android client because the password is now generated server side.

blacklight commented 11 years ago

Yes, my Android client has been updated, but how can I get the server-side password now? Sorry for my questions, but I can't find much documentation online about that...

Thanks, Fabio

philklc commented 11 years ago

I am facing the same problem. I bought some phone numbers just for sending WhatsApp messages, some of them still work fine to this day. some still return a "ok" status when checking the status of the account with --exists but always result in AUTH FAIL when I use them to send messages. Is this some new way of blocking unofficial clients?

tgalal commented 11 years ago

@BlackLight you cannot get the server side generated password anymore from an official Whatsapp client, unless you know where it's stored on your device.

@philklc exists now (v2) always returns a new password so you must update your config file too. exists v1 is deprecated so I wouldn't rely on that to work

Sree-Ravali commented 8 years ago

Hi, I used below link for yowsup installation https://github.com/tgalal/yowsup I am able to register my number and send messages from command prompt I am facing issue when I am trying to integrate with SAPUI5 I got the password in this format StxUI7Y0LhFHAO+4iD0BGPGFhjg= Is this the password format which i have to give as input to python code to authenticate Please reply asap

Thanks, Ravali

jlguardi commented 8 years ago

Yes, it is.

Sree-Ravali commented 8 years ago

But authentication is not happening please assist me