I'm trying to upload a image to google drive but it is returning 'Insufficient Permission: Request had insufficient authentication scopes.' I tried changing the scopes to DriveScopes.DRIVE_FILE, DriveScopes.DRIVE but it still throws the same error.
I'm using the sample code provided in google developer documentation
Java Quick start guide: https://developers.google.com/drive/api/v3/quickstart/java
Upload File: https://developers.google.com/drive/api/v3/manage-uploads
I enabled the drive api with desktop app option.