gdrive-getting-your-refresh-token
Laravel & Google Drive Storage: Getting Your Refresh Token
To integrate Google Drive with Laravel, you need a refresh token. This guide explains how to obtain it using the Google OAuth Playground.
Steps to Get Your Refresh Token
1. Open the OAuth Playground
- Visit Google OAuth Playground.
Note: Ensure you have already added the following URL to your Authorized Redirect URIs during the Google API setup:
https://developers.google.com/oauthplayground
2. Use Your OAuth Credentials
- Click the settings icon (⚙️) in the top-right corner of the OAuth Playground.
- Check "Use your own OAuth credentials".
- Enter your Client ID and Client Secret (from your Google Cloud Console).

3. Select the Drive API Scopes
- In Step 1, scroll to Drive API v3 and expand the section.
- Check the first scope:
https://www.googleapis.com/auth/drive.

4. Authorize APIs
- Click "Authorize APIs".
- Sign in to your Google account and allow access.
You may encounter some warning prompts. Proceed through them.
5. Exchange the Authorization Code
- In Step 2, check "Auto-refresh the token before it expires".
- Click "Exchange authorization code for tokens".

6. Retrieve the Refresh Token
- Once the exchange is successful, you will see your refresh token in Step 2.
- Copy and save this refresh token securely for later use.
