title: Google App Script User Scope Approval for new scope
body: <p>I've added the <code>script.external_request</code> scope to my GMail Add-on so that I can connect to and store information in a MySQL dB.</p>
  <p>The scope was submitted and approved by Google OAuth and Marketplace SDK.</p>
  <p>If I run the script in the editor from the HEAD deployment, I get the OAuth approval workflow and the script connects to the database.</p>
  <p>In the deployed version I keep getting the following error:</p>
  <p><code>You do not have permission to call Jdbc.getConnection. Required permissions: https://www.googleapis.com/auth/script.external_request</code></p>
  <p>It seems to me that the end users are not getting a trigger to accept the new scope from the UI of the addon.</p>
  <p>Is there a way to force the OAuth workflow re-authorization from the addon UI?</p>
  <p>Or is there something else going on here?</p>
  <p><strong>ADDED INFO</strong></p>
  <p>I used Aaron's suggestion on the QuickStart to add a logging check to see if the required permissions are present. At least this will point to if this might be a red-herring.</p>
  <pre><code>    if (authInfo.getAuthorizationStatus() ==
      ScriptApp.AuthorizationStatus.REQUIRED) {
          Logger.log(`${user} - Missing required scope authorizations`)
      }else{
          Logger.log(`${user} - Required scope authorizations present`)
      }
  </code></pre>
  <p>Naturally in the 12hrs this has been present, no user has opened the app. So will have to report back later.</p>
  <p>Also adding my appscript.json manifest</p>
  <pre><code>  &quot;timeZone&quot;: &quot;America/New_York&quot;,
    &quot;runtimeVersion&quot;: &quot;V8&quot;,
    &quot;addOns&quot;: {
      &quot;common&quot;: {
        &quot;name&quot;: &quot;GMailAddOn&quot;,
        &quot;logoUrl&quot;: &quot;https://lh3.googleusercontent.com/...&quot;,
        &quot;layoutProperties&quot;: {
          &quot;primaryColor&quot;: &quot;#2772ed&quot;
        },
        &quot;useLocaleFromApp&quot;: true
      },
      &quot;gmail&quot;: {
        &quot;homepageTrigger&quot;: {
          &quot;enabled&quot;: true,
          &quot;runFunction&quot;: &quot;initApp&quot;
        }
      }
    },
    &quot;exceptionLogging&quot;: &quot;STACKDRIVER&quot;,
    &quot;oauthScopes&quot;: [
      &quot;https://www.googleapis.com/auth/gmail.addons.execute&quot;,
      &quot;https://www.googleapis.com/auth/userinfo.email&quot;,
      &quot;https://www.googleapis.com/auth/userinfo.profile&quot;,
      &quot;https://www.googleapis.com/auth/script.send_mail&quot;,
      &quot;https://www.googleapis.com/auth/script.locale&quot;,
      &quot;https://www.googleapis.com/auth/script.scriptapp&quot;,
      &quot;https://www.googleapis.com/auth/gmail.modify&quot;,
      &quot;https://www.googleapis.com/auth/script.external_request&quot;
    ],
    &quot;urlFetchWhitelist&quot;: [
      &quot;https://google.com/&quot;
    ]
  }
  </code></pre>