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.64k stars 211 forks source link

403 org_internal error #274

Closed mweinstein closed 3 years ago

mweinstein commented 4 years ago

Attempting to connect to a gmail account, I get the following when I copy the shortened link into the browser (where I'm already logged in to the account):


Authorization Error
Error 403: org_internal
This client is restricted to users within its organization.
Request Details

    access_type=offline
    login_hint=REDACTED@gmail.com
    o2v=2
    response_type=code
    redirect_uri=urn:ietf:wg:oauth:2.0:oob
    state=mVvrjNKnnXhPjeikakBMasCoQuDp9V
    code_challenge_method=S256
    prompt=consent
    client_id=341167016164-em3fdsioth8lddgjcrr7es8p3vcfht76
    code_challenge=QSfWZuxzt4CGsaUh4pPoVGfA5_WnDZSH6qJdVizZ_a4
    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

This is a standard Gmail account, so the reference to "users within its organization" is odd. Possibly relevant, I previously used GYB to back up a G Suite account, but that was authenticated via a separate browser.

mweinstein commented 4 years ago

I found a solution, though I'm not sure it's the optimal one:

I renamed the oauth2service.json and client_secrets.json files in c:\gyb (I added .bak extensions). Once I did that, it was a lot like having a new install. When I went to run a backup estimate, I was walked through creating a new connection, creating a new API connection, etc. That then allowed the restore to function.

This made use of some steps and switches that were not in the documentation.

jxmesth commented 4 years ago

Having the same issue. Is there a fix for this?

johnathanz commented 4 years ago

Thanks @mweinstein . That worked.

For Mac users like myself, your client_secrets.json and oauth2service.json are in /Users/<yourUserName>/bin/gyb/

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.