

Here's the sample "oauth2" for the gdrive sample: "oauth2" : ) You need to update your manifest to include the client ID and scopes. # Update your manifest with OAuth2 client ID and scopes Warning: If the app ID here does not match your app ID, an error will occur when your app calls getAuthToken(). Select Chrome Application and enter your application ID (same ID displayed in the apps and extensions management page).Enter the requested branding information, select the Installed application type.Go to the "API Access" navigation menu item and click on the Create an OAuth 2.0 client ID.Once created and named, go to the "Services" navigation menu item and turn on any Google services your app needs.Create a new project by expanding the drop-down menu in the top-left corner and selecting the Create.Login to the Google APIs Console using the same Google account used to upload your app to the Chrome Web Store.You need to register your app in the Google APIs Console to get the client ID: Copy the "key" in the installed manifest.json and paste it into your app's source manifest file.Open the installed manifest.json (pico is a quick way to open the file). Go to the installed app directory (this will be a version within the app ID).List the installed apps and extensions and match your app ID on the apps and extensions management page to the same ID here.Example on MacOs: ~/Library/Application\ Support/Google/Chrome/Default/Extensions

It's not the most graceful task, but here's how it goes: To keep your application ID constant, you need to copy the key in the installed manifest.json to your source manifest.

Therefore it's important to have a consistent application ID during development. When you register your application in the Google OAuth console, you'll provide your application's ID, which will be checked during token requests. You can then upload your app to the apps and extensions management page (see Publish). You need to make sure the identity permission is in your manifest.
