title: How to re-authenticate when upgrading the scope of the Google Drive API
body: <p>I have an web application which has a working access to the Google Drive (TeamDrive folders). It runs on WordPress and PHP. It reads the content of the drive and displays the folders/files and enables downloading the files. Everything works fine but now I would need to add a file upload functionality to it. The current scope is DRIVE_READONLY which needs to be upgraded to DRIVE allowing the write (file create) functionality.</p>
  
  <p>I have changed the scope to DRIVE everywhere in the code and added the auth/drive scope in the OAuth consent screen in the Google console. However the scope in the credentials JSON file says "https://www.googleapis.com/auth/drive.readonly". And  when trying to upload a file the Google API responses with an error "Insufficient Permission: Request had insufficient authentication scopes.". I guess the problem is in the json and I would need to do the authentication again to upgrade the credentials to the new scope.</p>
  
  <p>How do I do that when I have an application which is up and running in the production? I was not able to find any guidance how to do it. Should I do it in the console, by login with the user which is used in the application or in the CLI or how?</p>
  
  <p>The code is PHP and it uses the Google API client and the classes which are working nice when reading the Drive, doing searches against the content on the Drive.</p>