GAM-team / got-your-back

Got Your Back (GYB) is a command line tool for backing up your Gmail messages to your computer using Gmail's API over HTTPS.
https://github.com/GAM-team/got-your-back/wiki
Apache License 2.0
2.6k stars 205 forks source link

Error 403: org_internal #389

Closed Craigp23 closed 2 years ago

Craigp23 commented 2 years ago

Hi, I'm using GYB for the first time.

Trying a backup mail from a Google Workspace account to my new gmail.com account. The backup appears to have completed successfully. However, when I ran :

gyb --email newaddress@gmail.com --action restore --local-folder GYB-GMail-Backup-oldaddress@gmail.com

substituting newaddress@gmail.com and oldaddress@gmail.com with the actual addresses, a browser page opened, prompted for address and password, and then displayed:

Authorisation Error

Error 403: org_internal

This client is restricted to users within its organization.

Request Details The content in this section has been provided by the app developer. This content has not been reviewed or verified by Google. If you’re the app developer, make sure that these request details comply with Google policies. access_type: offline login_hint: ****@gmail.com response_type: code redirect_uri: http://127.0.0.1:8080/ state: tyKDfh2Elb8AGbynPYqsvM7i0Wacoc code_challenge_method: S256 client_id: * code_challenge: ***** scope: https://www.googleapis.com/auth/userinfo.email https://mail.google.com/ https://www.googleapis.com/auth/apps.groups.migration https://www.googleapis.com/auth/drive.appdata openid

Any tips on how best to proceed are much appreciated :)

NoSubstitute commented 2 years ago

You need to set up GYB for your private Gmail account separately.

Remember to first move/backup your JSON files from the Workspace setup!

Craigp23 commented 2 years ago

Thank you! :) I'll try that and report back here...

Update : The restore is running :) Here's the steps taken :

  1. Moved the previous (oldaddress@gmail.com) json files in the gyb local folder to a backup folder
  2. Ran gyb --action create-project --email youremail@gmail.com
  3. Followed the prompts. The process flowed as when preparing for the backup a coupe of days ago, except when it came to the 'Enter your Client ID:' step.
  4. At the 'Enter your Client ID:' step the browser window displayed a different 'OAuth consent screen' : User type - Internal (disabled), External.
  5. Selected External and clicked Create.
  6. At the Scopes page, I added the 'Gmail API' scope (read, compose, send and permanently delete all your email from Gmail)
  7. Clicked on 'Credentials' in the left hand menu.
  8. Clicked '+Create Credentials' in the menu at the top
  9. Chose 'Desktop App' and clicked 'Create'
  10. Copied the Client ID and Client Secret to the GYB console window
  11. GYB setup completed for the restore target account newaddress@gmail.com

Next ran gyb --email newaddress@gmail.com --action restore --local-folder GYB-GMail-Backup-oldaddress@gmail.com to successfully begin the restore.

Hopes this helps others to perform a restore 🙏

On Mon, 4 Jul 2022, 11:07 Kim Nilsson, @.***> wrote:

You need to set up GYB for your private Gmail account separately.

Remember to first move/backup your JSON files from the Workspace setup!

— Reply to this email directly, view it on GitHub https://github.com/GAM-team/got-your-back/issues/389#issuecomment-1173623064, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASNCFWRG2KKKXWRLL3DBAZLVSKZUXANCNFSM52RDMJRQ . You are receiving this because you authored the thread.Message ID: @.***>