I am setting up the Google Drive API to take automatic backups of my PHP website. I created a new project in Google Cloud Console, enabled the Google Drive API, and generated the Client ID and Client Secret using OAuth 2.0.
However, as soon as I try to get a Refresh Token or connect my app to my Google account, I get this error on the login screen:
Access blocked: backup App has not completed the Google verification process
Error 403: access_denied
What I don't understand is that I created this app myself and I am logging in with my own Gmail account, so why is Google blocking me? I double-checked my Redirect URI and everything is correct. Do I really need to get my app verified by Google just for a personal backup script? If anyone has faced this problem before, please let me know how to fix it
I ran into the exact same Error 403 last week while setting up a PHP and Cron Job Google Drive auto-backup system for my website. At first, I also thought there was something wrong with my code or Redirect URI, but it turns out this isn't a coding problem at all.
What happens is that whenever you create a new OAuth app in Google Cloud Console, Google keeps it in "Testing" mode by default. In this mode, Google is strict—until you manually add your own email address to their tester list, it won't even let you log into the app you created.
The good news is that you do not need to go through Google's verification process for a personal backup app. There are two ways to fix this, and from my experience, the second method is much better in the long run:
Open your Google Cloud Console and go to APIs & Services → OAuth consent screen from the left menu (in the newer interface, you'll see this under Google Auth Platform → Audience).
Scroll down to the Test users section.
Click + ADD USERS, enter the exact Gmail ID you are trying to log in with, and hit Save.
Doing this will remove the Error 403 immediately.
At first, I also just added myself as a Test User and my backups started working fine. But exactly 7 days later, my Cron Job suddenly failed and started throwing an invalid_grant error. After looking into it, I learned that in Google's Testing mode, a Refresh Token only stays valid for 7 days and then expires automatically.
So if you are setting this up for regular automatic backups, do this instead:
On that same OAuth consent screen (or Audience) page, look under Publishing status and click the "PUBLISH APP" button, then click Confirm.
Don't worry—publishing the app is completely free, and you don't have to fill out any Google verification form if it's only for your own use. This just changes the status to In Production.
Now when you connect again, instead of Access blocked, you will see a warning screen that says "Google hasn't verified this app".
Click the small Advanced link at the bottom left, then click Go to [Your App Name] (unsafe) and press Continue. Since you built this app yourself, there is nothing to worry about with the "unsafe" warning.
Once you finish this setup, your Refresh Token will no longer expire after 7 days.
One small thing to double-check: If you still see the same error after saving these settings, try logging in through an Incognito Window. Sometimes Chrome holds onto old cache, or it accidentally selects a different Gmail account if you have multiple accounts logged into the same browser.