whapp-irc icon indicating copy to clipboard operation
whapp-irc copied to clipboard

qr code authentication

Open skibz opened this issue 6 years ago • 3 comments
trafficstars

i've been working on improving the automatability of whapp-irc on behalf of my employer. one of the trickiest aspects of automating it we've experienced so far has been with whatsapp's qr code authentication.

as of the most current version of the system, connecting to the irc server exposed by the system triggers the scraping of the webpage to exfiltrate the qr code so that it may be serialised as an image file, ultimately allowing a person to scan the code to authenticate the client.

this process is only performed once by the system, however. if the user misses the window period for scanning the qr code before a new one is generated, they will be forced to restart whapp-irc as it is not able to scrape subsequent qr codes.

moreover, after five (i think) qr codes have been generated by whatsapp, the qr code becomes covered with a button that prevents any more qr codes from being visible.

so, what i'm getting at is that i've been writing additions to the system to handle these behaviours of whatsapp, specifically:

  • asynchronously retrieving the latest qr code as it is generated (based on what i have observed, this happens every twenty seconds)
  • continue to scrape the qr code until the client has moved to the logged in state
  • the ability to send the qr code binary image data to another server via http whenever a new qr code has been detected
  • clicking on the qr code area when it has been detected that another element has occluded the qr code

the goal of this work has been to get whapp-irc to the point where it can remain idle in an unauthenticated state indefinitely.

we (my employer) intend on using it in a highly automated fashion, so this kind of behaviour is absolutely essential.

would you (@lieuwex) be interested in using these additions to the system that i have described?

skibz avatar Jan 23 '19 07:01 skibz

This sounds really nice as an addition for sure, if you can build it in a not-too-messy way I will merge it for sure, I don't see any downsides(?)

I'm only a bit confused about:

the ability to send the qr code binary image data to another server via http whenever a new qr code has been detected

Can you further elaborate on that?

lieuwex avatar Jan 23 '19 20:01 lieuwex

Can you further elaborate on that?

i guess it's just in the realm of "nice to haves". no problem if you'd prefer to not have it.

as for the rest of the solution, i've nearly got something that's at a stage suitable for your review.

skibz avatar Jan 23 '19 22:01 skibz

Well, FWIW, the QR code is just a file on disk and shared using the fileserver as long as the qr code hasn't been scanned yet.

lieuwex avatar Jan 26 '19 13:01 lieuwex