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

{'Error': 'BadAuthentication'} #47

Closed
LightYagami28 opened this issue Dec 5, 2022 · 16 comments
Closed

{'Error': 'BadAuthentication'} #47

LightYagami28 opened this issue Dec 5, 2022 · 16 comments

Comments

@LightYagami28
Copy link

I don’t know what is the problem i set the settings.cfg perfect.

Pls help

@louisdoe
Copy link

Same here. BadAuthentication

@imponateado
Copy link

getting same exact issue, seems like a malformation issue on gpsoauth

@guysoft
Copy link

guysoft commented Dec 29, 2023

Anyway around it?

@fei0316
Copy link

fei0316 commented Jan 6, 2024

Found a pretty ugly workaround but it works.

  1. Instead of installing the gpsoauth dependency as instructed, install it from this fork:
pip install git+https://github.com/kiwiz/gpsoauth@master
  1. Make some changes to WhatsAppGDExtract.py:
class WaBackup:
    """
    Provide access to WhatsApp backups stored in Google drive.
    """
    def __init__(self, gmail, password, android_id):
        #token = gpsoauth.perform_master_login(gmail, password, android_id)
        token = gpsoauth.exchange_token(gmail, "YOUR_TOKEN_HERE", android_id)
        if "Token" not in token:
            quit(token)
        self.auth = gpsoauth.perform_oauth(
            gmail,
            token["Token"],
            android_id,
  1. Get the token from here. After you click on "I agree" it will load forever, grab the content of the oauth_token cookie and replace YOUR_TOKEN_HERE.
  2. Proceed as normal, except you will need to repeat step 3 before each command as the token is single-use.

The problem is that the normal login routine of gpsoauth, using the gmail address and password, is not working, therefore we use the oauth token for login instead.

@guysoft
Copy link

guysoft commented Jan 6, 2024

Thanks for posting a workaround - even if it takes making a token, this is useful.
I can confirm I can download it all using that. I guess some automation can be done with selenium or something like that. But for now as a one-off backup that is helpful.

BTW - does anyone know how to decrypt and view the messages?

@fei0316
Copy link

fei0316 commented Jan 7, 2024

@guysoft I don't think it's really worth it to automate this procedure as a fix to the master_login is being worked on already. If you still have a running WhatsApp installation and can backup again, the easiest way is to enable end-to-end encryption then decrypt the data with your own key: link. If you must extract the copy you have on GDrive, you can try WhatsApp-Key-DB-Extractor.

@guysoft
Copy link

guysoft commented Jan 7, 2024

The issue with the workaround is that after a while I get:

Http Error: 401 Client Error: Unauthorized for url: https://backup.googleapis.com/v1/clients/wa/backups/[number]/files

So I guess the token expires

@guysoft
Copy link

guysoft commented Jan 8, 2024

@fei0316 did anyone say that there is effort to fix the master_login anywhere? Could not see any mention

@fei0316
Copy link

fei0316 commented Jan 8, 2024

@fei0316 did anyone say that there is effort to fix the master_login anywhere? Could not see any mention

You can check out this.

@YuriCosta
Copy link
Owner

I'm using gpsoauth 1.0.2, everything works fine.
BadAuthentication can be 2FA enabled on your account so you will need to get an app password from your google account.

@fei0316
Copy link

fei0316 commented Jan 9, 2024

My account does use 2FA but I am using the app password already. Though I think this issue is not related to this project at all but rather gpsoauth.

@Sarmingsteiner
Copy link

Sarmingsteiner commented Mar 9, 2024

@fei0316 : You are my live safer, the only working solution I have found to get access to our Google Drive backup!

Only one thing has to be changed: pip install git+https://github.com/kiwiz/gpsoauth@master is not available any more, but it works with Simon's version as well: pip install git+https://github.com/simon-weber/gpsoauth@master

@southall01
Copy link

Hello, if i double click on WhatsAppGDExtract is just open and closes....

@azh97
Copy link

azh97 commented Mar 31, 2024

@fei0316 : You are my live safer, the only working solution I have found to get access to our Google Drive backup!

Only one thing has to be changed: pip install git+https://github.com/kiwiz/gpsoauth@master is not available any more, but it works with Simon's version as well: pip install git+https://github.com/simon-weber/gpsoauth@master

I tried the following workaround, but keeps getting the following error. Any suggestions?
Already tried 2FA with app password and also the actual email password with 2FA disabled.

File "D:\WhatsApp-GD-Extractor-Multithread-master\WhatsAppGDExtractRevised.py", line 258, in <module>
    main(sys.argv)
  File "D:\WhatsApp-GD-Extractor-Multithread-master\WhatsAppGDExtractRevised.py", line 207, in main
    wa_backup = WaBackup(**getConfigs())
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\WhatsApp-GD-Extractor-Multithread-master\WhatsAppGDExtractRevised.py", line 64, in __init__
    token = gpsoauth.exchange_token(gmail, "oauth2_4/0AeaYSHDBw_SbkAavTf7T4P-OTKpCNMv1PO6dNAUZ5INodeOVj35LFwfuLes3m-xy6ZXXxxQ", android_id)
            ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gpsoauth' has no attribute 'exchange_token'

@southall01
Copy link

I'm getting this;
AttributeError: module 'gpsoauth' has no attribute 'exchange_token'

@YuriCosta
Copy link
Owner

I don't know why this thread is still getting so many comments, some even with unrelated problems.
I just tried it again with my personal account from scratch.

  1. Download the script, the requirement and config.
  2. fill you info in the config file, if you have 2FA use app password
  3. create venv, activate it, pip install -r requirement.
  4. run the script.

Worked flawlessly with my 2FA account here.

Repository owner locked and limited conversation to collaborators Mar 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants