0

I built a Google Chat bot with Apps Script and published it to the Google Workspace Marketplace. It works fine in testing or for anyone with editor access to the Apps Script project.

The problem: when regular users try it, they get the OAuth consent screen, but instead of being returned to the chat app, they’re redirected to an Apps Script page saying “You need access” with editor permissions pre-selected. Users shouldn’t need edit access just to use the bot.

I’ve checked all the settings and gone back and forth with support, but nothing has fixed it. What might be causing this?

Details:

  • Bot uses app-level authentication only (no user auth).
  • The project uses Script Properties -- could that be related?

Steps to reproduce:

  1. End user opens a direct message with the bot in Google Chat
  2. The bot asks them to configure before using with a button
  3. When they click the configure button, the Oauth screen opens with the expected scopes
  4. When they grant access to the needed scopes:
  • Expect: they are redirected back to Google Chat and are able to use the chat bot.
  • Result: they are redirected to the pictured "You need access" page in Apps Script asking them to request edit access to the Apps Script project.

enter image description here

Manifest file:

{ "timeZone": "America/New_York", "dependencies": { "enabledAdvancedServices": [ { "userSymbol": "Chat", "version": "v1", "serviceId": "chat" } ], "libraries": [ { "userSymbol": "OAuth2", "version": "43", "libraryId": "1B7FSrk5Zi6L1rSxxTDgDEUsPzlukDsi4KGuTMorsTQHhGBzBkMun4iDF" } ] }, "exceptionLogging": "STACKDRIVER", "runtimeVersion": "V8", "oauthScopes": [ "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/script.external_request" ], "addOns": { "common": { "name": "...", "logoUrl": "..." }, "chat": {} } } 
3
  • 1
    Have you tried creating a new deployment with an access set to Anyone in the Apps Script project? This might be causing the issue. See Create and manage deployments. Commented Sep 3 at 19:27
  • @Gyul The issue is that chat add-on type projects don't have this setting. I think the issue was caused by a mismatch between the "internal" Oauth screen type and the workspace marketplace API config. Commented Sep 4 at 21:00
  • 1
    Could the problem be that the User Type on your OAuth consent screen is set to Internal instead of External? Also, you might find this StackOverFlow post relevant. Commented Sep 4 at 21:44

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.